2017-12-20 04:51:32 +01:00
|
|
|
# httpie
|
|
|
|
|
|
|
|
> A human-friendly CLI HTTP tool.
|
|
|
|
|
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
|
|
|
|
|
|
|
`http {{https://api.github.com/users}}`
|
|
|
|
|
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
|
|
|
|
|
|
|
`http {{example.org}} {{hello=World}}`
|
|
|
|
|
2017-12-20 13:27:08 +01:00
|
|
|
- Send a POST request with redirected input:
|
2017-12-20 04:51:32 +01:00
|
|
|
|
|
|
|
`http {{example.org}} < {{file.json}}`
|
|
|
|
|
2017-12-20 13:27:08 +01:00
|
|
|
- Send a PUT request:
|
2017-12-20 04:51:32 +01:00
|
|
|
|
|
|
|
`http PUT {{httpbin.org/put}} {{API-Key:foo hello=world}}`
|
|
|
|
|
2017-12-20 13:27:08 +01:00
|
|
|
- Send a DELETE request:
|
2017-12-20 04:51:32 +01:00
|
|
|
|
|
|
|
`http DELETE {{example.org/todos/7}}`
|
|
|
|
|
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
|
|
|
|
|
|
|
`http -v {{example.org}}`
|
|
|
|
|
2017-12-20 13:27:08 +01:00
|
|
|
- Download a file:
|
2017-12-20 04:51:32 +01:00
|
|
|
|
|
|
|
`http --download {{example.org}}`
|