Windows 終端機使用 curl 發送 POST 請求
2023/02/08
萌芽站長
1,689 2
作業系統 , Windows
⚠️ 溫馨提醒:我們發現您可能啟用了廣告阻擋器,請將本站加入白名單以正常閱讀文章內容,謝謝支持 ❤️
這邊教大家用 curl 在 Windows 終端機上發送 POST 請求,以測試 API 是否能正常回傳資訊。以下為示範:
curl -X POST ^
https://example.com/json ^
-H "Content-Type: application/json" ^
-d "{ ""user"": ""test"", ""token"": ""42364d7c67acd29c3c15ddf544c33671"", ""XXX"": ""YYY""}"
基本上就是把 URL 的部分改成你要的,-H 標頭已經幫忙設定為「Content-Type: application/json」,也就是發送 JSON 資訊,接著 -d 的部分就是整個要發送的 JSON 資訊囉!記得要用雙引號。

▲ 實際用上真的很方便,能直接用來測試 API 是否正常。
贊助廣告 ‧ Sponsor advertisements
【Windows 8.1】安裝Google Chrome教學
📆 2014-04-22
📁
瀏覽器, 作業系統, Windows, Google Chrome
WSL&Ubuntu:如何從外部瀏覽器開啟內部 Apache 伺服器架設之網站
📆 2022-01-18
📁
作業系統, 伺服器, Windows, Linux, Ubuntu
Ubuntu:解決 ifconfig 無法使用的問題
📆 2021-10-12
📁
作業系統, 伺服器, Linux, Ubuntu
【Windows 10】Microsoft 最新釋出 Build 10586
📆 2015-11-13
📁
作業系統, Windows
【Windows 7】我的系統是32位元還是64位元?
📆 2014-08-27
📁
作業系統, Windows
Windows 10 正式終止支援:你的電腦,即日起不再安全!
📆 2025-10-15
📁
作業系統, 資訊新聞, 資訊安全, Windows
【Ubuntu 14.04 LTS】左側啟動器設定教學
📆 2014-04-21
📁
作業系統, Linux, Ubuntu
ASUS T100TA 安裝 Android 6.0、Windows 10 Pro
📆 2016-08-24
📁
行動平台, 作業系統, Windows, Android
留言區 / Comments
萌芽論壇