-X (HTTP)指定与服务器通信使用的请求方法,如:GET、PUT、POST、DELETE等,默认GET;
-H 请求头
-d 传输的信息
一、发送GET请求
curl http://example_url
curl -X GET http://example_url
在header中加token
curl -X GET -H "Authorization: Bearer EXAMPLE_TOKEN" http://example_url
二、发送POST请求
curl -H "Content-Type: application/json" -X POST -d '{example_data}' http://example_url
三、其他
1、在header中加token
curl -H "Authorization: Bearer EXAMPLE_TOKEN" http://example_url
参考: