curl 发送post请求 带header 带参数

 

 

curl -H "header省略..." -H "第二个header省略..." -d '参数...' -X POST 地址

 

curl -H "Rpc-XXX-Request:ask=953&answer=953&serialNo=4295106143703859503&idemSerialNo=242&serviceScene=10&sign=38316882927200" -H "Content-Type:application/x-www-form-urlencoded" -d 'startDate=20200920&endDate=20201120' -X POST http://localhost:10037/urlxxxxxx

 

 

 

 

 

 

curl -l -H "Content-type: application/json;charset=UTF-8" -H "Rpc-XXX-Request:ask=931&answer=931&serialNo=4295106143703859503&idemSerialNo=2142&serviceScene=10&transDateTime=20200101000000&tenantId=000&channelNo=channelNo&sign=38316882927200"  -X POST -d '{"startDate": "2021-01-12 00:00:01" , "endDate": "2021-01-14 00:01:01"}' http://localhost:10037/hsjry/report/v1/generateReprotBatch/areaGenerateBaoliReportTwo
对应后端    @RequestBody 接参数

 

你可能感兴趣的:(linux,curl,linux)