2017-12-20 03:51:32 +00:00
|
|
|
# httpie
|
|
|
|
|
2021-05-20 21:13:41 +01:00
|
|
|
> A user friendly command-line HTTP tool.
|
2021-09-02 19:33:49 +01:00
|
|
|
> More information: <https://github.com/httpie/httpie>.
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-20 12:27:08 +00:00
|
|
|
- Send a GET request (default method with no request data):
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-22 03:57:22 +00:00
|
|
|
`http {{https://example.com}}`
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-20 12:27:08 +00:00
|
|
|
- Send a POST request (default method with request data):
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-22 03:57:22 +00:00
|
|
|
`http {{https://example.com}} {{hello=World}}`
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-20 12:27:08 +00:00
|
|
|
- Send a POST request with redirected input:
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-22 03:57:22 +00:00
|
|
|
`http {{https://example.com}} < {{file.json}}`
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Send a PUT request with a given JSON body:
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-22 03:57:22 +00:00
|
|
|
`http PUT {{https://example.com/todos/7}} {{hello=world}}`
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-22 03:57:22 +00:00
|
|
|
- Send a DELETE request with a given request header:
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-22 03:57:22 +00:00
|
|
|
`http DELETE {{https://example.com/todos/7}} {{API-Key:foo}}`
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-20 12:27:08 +00:00
|
|
|
- Show the whole HTTP exchange (both request and response):
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-22 03:57:22 +00:00
|
|
|
`http -v {{https://example.com}}`
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-20 12:27:08 +00:00
|
|
|
- Download a file:
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-22 03:57:22 +00:00
|
|
|
`http --download {{https://example.com}}`
|
2022-02-17 10:46:07 +00:00
|
|
|
|
|
|
|
- Follow redirects and show intermediary requests and responses:
|
|
|
|
|
|
|
|
`http --follow --all {{https://example.com}}`
|