curl localhost:9009/setCreateDataItem?a=1&b=nihao
curl -X POST -d 'a=1&b=nihao' localhost:9009/setCreateDataItem
curl -H "Content-Type: application/json" -X POST -d '{"abc":123,"bcd":"nihao"}' localhost:9009/setCreateDataItem
curl -H "Content-Type: application/json" -X POST -d @test.json localhost:9009/setCreateDataItem
其中,-H代表header头,-X是指定什么类型请求(POST/GET/HEAD/DELETE/PUT/PATCH),-d代表传输什么数据。这几个是最常用的。
查看所有curl命令: man curl或者curl -h
请求头:H,A,e
响应头:I,i,D
cookie:b,c,j
传输:F(POST),G(GET),T(PUT),X
输出:o,O,w
断点续传:r
调试:v,--trace,--trace-ascii,--trace-time