官网:https://curl.se/
手册:https://curl.se/docs/manpage.html
脚本:https://curl.se/docs/httpscripting.html
命令:
发送 JSON 格式的 POST 请求
调用接口提交数据(需指定 Content-Type: application/json):
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-d '{"username":"testuser","email":"test@example.com"}' \
https://api.example.com/register参数: