mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-09-10 17:13:50 +02:00
http: add
This commit is contained in:
parent
a74d7f770e
commit
1d062a94f0
1 changed files with 39 additions and 0 deletions
39
pages/common/http.md
Normal file
39
pages/common/http.md
Normal file
|
@ -0,0 +1,39 @@
|
|||
# http
|
||||
|
||||
> HTTPie: HTTP client, a user-friendly cURL replacement.
|
||||
|
||||
- Download a URL to a file:
|
||||
|
||||
`http -d {{example.org}}`
|
||||
|
||||
- Send form-encoded data:
|
||||
|
||||
`http -f {{example.org}} {{name='bob'}} {{profile-picture@'bob.png'}}`
|
||||
|
||||
- Send JSON object:
|
||||
|
||||
`http {{example.org}} {{name='bob'}}`
|
||||
|
||||
- Specify an HTTP method:
|
||||
|
||||
`http {{HEAD}} {{example.org}}`
|
||||
|
||||
- Include an extra header:
|
||||
|
||||
`http {{example.org}} {{X-MyHeader:123}}`
|
||||
|
||||
- Pass a user name and password for server authentication:
|
||||
|
||||
`http -a {{username:password}} {{example.org}}`
|
||||
|
||||
- Specify raw request body via stdin:
|
||||
|
||||
`cat data.txt | http PUT example.org`
|
||||
|
||||
- View both the response and the request being sent:
|
||||
|
||||
`http -v {{example.org}}`
|
||||
|
||||
- Send JSON object with non-string fields:
|
||||
|
||||
`http {{example.org}} {{name='bob'}} {{age:=29}} {{married:=false}} hobbies:='["http", "pies"]`
|
Loading…
Add table
Reference in a new issue