2017-12-20 04:51:32 +01:00
|
|
|
# httpie
|
|
|
|
|
2017-12-22 04:00:30 +01:00
|
|
|
> A user friendly command line HTTP tool.
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-20 13:27:08 +01:00
|
|
|
- Send a GET request (default method with no request data):
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-22 04:57:22 +01:00
|
|
|
`http {{https://example.com}}`
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-20 13:27:08 +01:00
|
|
|
- Send a POST request (default method with request data):
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-22 04:57:22 +01:00
|
|
|
`http {{https://example.com}} {{hello=World}}`
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-20 13:27:08 +01:00
|
|
|
- Send a POST request with redirected input:
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-22 04:57:22 +01:00
|
|
|
`http {{https://example.com}} < {{file.json}}`
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-22 04:00:30 +01:00
|
|
|
- Send a PUT request with a given json body:
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-22 04:57:22 +01:00
|
|
|
`http PUT {{https://example.com/todos/7}} {{hello=world}}`
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-22 04:57:22 +01:00
|
|
|
- Send a DELETE request with a given request header:
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-22 04:57:22 +01:00
|
|
|
`http DELETE {{https://example.com/todos/7}} {{API-Key:foo}}`
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-20 13:27:08 +01:00
|
|
|
- Show the whole HTTP exchange (both request and response):
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-22 04:57:22 +01:00
|
|
|
`http -v {{https://example.com}}`
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-20 13:27:08 +01:00
|
|
|
- Download a file:
|
2017-12-20 04:51:32 +01:00
|
|
|
|
2017-12-22 04:57:22 +01:00
|
|
|
`http --download {{https://example.com}}`
|