curl 命令簡介

curl命令用於在命令行中發送HTTP請求:json

curl -i -H 'content-type: application/json' -X POST -d '{"name":"abc"}' http://127.0.0.1:3002/api/api

說明:app

  • -i 用於表示須要返回HTTP Response頭信息。
  • -H 表示HTTP Request 頭信息。
  • -X 表示HTTP method
  • -d 表示HTTP Request Body內容。
  • 最後跟上請求的url。
相關文章
相關標籤/搜索