curl: add separate entry for header & HTTP method; clarify entry for JSON (#1396)

coverage
Zhou Fangyi 2017-06-06 08:23:00 +01:00 committed by Waldir Pimenta
parent efedbb2835
commit 5a17e68729
1 changed files with 6 additions and 2 deletions

View File

@ -19,9 +19,13 @@
`curl -d {{'name=bob'}} {{http://example.com/form}}`
- Send data, specifying a custom HTTP method, and including an extra header:
- Send a request with an extra header using a custom HTTP method:
`curl -d {{'{"name":"bob"}'}} -X {{PUT}} -H {{'Content-Type: application/json'}} {{http://example.com/users/1234}}`
`curl -H {{'X-My-Header: 123'}} -X {{PUT}} {{http://example.com}}`
- Send data in JSON format, specifying the appropriate content-type header:
`curl -d {{'{"name":"bob"}'}} -H {{'Content-Type: application/json'}} {{http://example.com/users/1234}}`
- Pass a user name and password for server authentication and show headers info only: