GET
curl请求可以直接调用,对?
&
要用\
来转义,也可以用""
来包裹
curl localhost:8081/post\?id=1234\&page=1
curl "localhost:8081/post?id=1234&page=1"
POST
application/x-www-form-urlencoded
| application/json
curl localhost:8081
-d "a=1&b=2"
multipart/form-data
curl -F "file=@localfile;filename=nameinpost" example.com
application/json
Header
curl -H "X-First-Name: Joe" http://example.com/
网友评论