Windows 終端機使用 curl 發送 POST 請求
2023/02/08
萌芽站長
1,503 0
作業系統 , 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】快捷鍵:別再找我的電腦在哪了,只要一步驟,贏過別人!
📆 2014-03-02
📁
作業系統, Windows
【Windows】製作Win7佈景主題
📆 2013-11-28
📁
作業系統, Windows
Ubuntu:使用 ip route 與 nmcli 設定靜態路由的完整教學與差異分析
📆 2025-11-05
📁
作業系統, 伺服器, Linux, Ubuntu
【Windows 7】移除右鍵選單中的「新增」項目
📆 2015-06-26
📁
作業系統, Windows
Linux:chown 指定檔案或目錄的擁有者與群組
📆 2022-01-07
📁
作業系統, 伺服器, Linux
QuickLook:Windows 空白鍵預覽工具、快速預覽任何格式的檔案
📆 2018-07-15
📁
作業系統, Windows
Windows 10 創作者更新(Creators Update)搶先體驗!
📆 2017-04-06
📁
作業系統, 資訊新聞, Windows
Ubuntu:打開 root 的 SSH 登入權限
📆 2021-10-13
📁
作業系統, 資訊安全, 伺服器, Linux, Ubuntu
留言區 / Comments
萌芽論壇