tldr/pages/linux/httpie.md

32 lines
728 B
Markdown
Raw Normal View History

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