目录
get
curl --location --request GET 'http://xxxx?param1=2027xxxx'
url参数中涉及特殊字符的参数部分需要转义,多个参数时url需要加双引号!!!!
例如:
curl "http://localhost:8080/xxx/delete?startDate=2022-01-28 00:00:00"
请求不通,需要改成
curl "http://localhost:8080/xxx/delete?startDate=2022-01-01%2000:00:00"
或
curl "http://localhost:8080/xxx/delete?startDate=2022-01-01%2000%3A00%3A00"
post + json
curl --location --request POST "http://xxxxx" -H "Content-Type: application/json" -d "{\"empCodes\":[\"xxxx\"],\"pageNum\":1,\"pageSize\":200}"
--或
curl --location --request POST 'http://xxxxx' -H 'Content-Type: application/json' -d '{"empCodes":["xxx"],"pageNum":1,"pageSize":200}'
请求实体中的数据用这个网址压缩+转义
批量请求curl
curl http://xx & curl http://xx