最常用的curl命令
1、发送GET请求
curl URL
例:
curl URL?a=1&b=nihao
2、发送POST请求
curl -X POST -d 'a=1&b=nihao' URL
3、发送json格式请求
curl -H "Content-Type: application/json" -X POST -d '{"abc":123,"bcd":"nihao"}' URL
例:
curl -H "Content-Type: application/json" -X POST -d @test.json URL
curl -k -X POST -H "Content-Type: application/json" -H "referer:https://api-dis-e100-ensaas.com" https://api-dis-e100-ensaas.com/api/v1/data/query -d '{"sql": "SELECT * FROM `main.oracle.MZDBA.煤质化验结果` WHERE `采样日期`>='2021-01-01' AND `采样日期`<='2021-01-03'"}'