2016-02-28 10:17:45 +00:00
|
|
|
# http
|
|
|
|
|
2020-02-17 14:22:19 +00:00
|
|
|
> HTTPie: HTTP client, aims to be easier to use than cURL.
|
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:
|
|
|
|
|
2016-07-22 21:24:06 +01:00
|
|
|
`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}}`
|
2016-02-29 09:47:42 +00:00
|
|
|
|
2019-06-17 16:00:38 +01:00
|
|
|
- Specify raw request body via `stdin`:
|
2016-02-29 09:47:42 +00:00
|
|
|
|
2016-10-21 16:56:02 +01:00
|
|
|
`cat {{data.txt}} | http PUT {{example.org}}`
|