2017-12-20 03:51:32 +00:00
|
|
|
# httpie
|
|
|
|
|
2017-12-22 03:00:30 +00:00
|
|
|
> A user friendly command line HTTP tool.
|
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
|
|
|
|
|
|
|
`http {{https://api.github.com/users}}`
|
|
|
|
|
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
|
|
|
|
|
|
|
`http {{example.org}} {{hello=World}}`
|
|
|
|
|
2017-12-20 12:27:08 +00:00
|
|
|
- Send a POST request with redirected input:
|
2017-12-20 03:51:32 +00:00
|
|
|
|
|
|
|
`http {{example.org}} < {{file.json}}`
|
|
|
|
|
2017-12-22 03:00:30 +00:00
|
|
|
- Send a PUT request with a given json body:
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-22 03:00:30 +00:00
|
|
|
`http PUT {{httpbin.org/put}} {{hello=world}}`
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-22 03:00:30 +00:00
|
|
|
- Send a DELETE request with a giben header:
|
2017-12-20 03:51:32 +00:00
|
|
|
|
2017-12-22 03:00:30 +00:00
|
|
|
`http DELETE {{example.org/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
|
|
|
|
|
|
|
`http -v {{example.org}}`
|
|
|
|
|
2017-12-20 12:27:08 +00:00
|
|
|
- Download a file:
|
2017-12-20 03:51:32 +00:00
|
|
|
|
|
|
|
`http --download {{example.org}}`
|