tldr/pages/common/http.md

33 lines
648 B
Markdown
Raw Normal View History

2016-02-28 10:17:45 +00:00
# http
> HTTPie: HTTP client, a user-friendly cURL replacement.
2019-06-07 11:58:30 +01:00
> More information: <https://httpie.org>.
2016-02-28 10:17:45 +00:00
- Download a URL to a file:
`http -d {{example.org}}`
- Send form-encoded data:
`http -f {{example.org}} {{name='bob'}} {{profile_picture@'bob.png'}}`
2016-02-28 10:17:45 +00:00
- 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}}`