httpie
curl ale z sensownym outputem — JSON, form, auth.
Opis
httpie — następca curl dla API. Sensowny output (JSON, form), auto-detect Content-Type, auth, streaming. http GET url, http POST url key=value, http -a user:pass. httpie = 'curl ale wygodne'.
Przykłady
$ http GET https://api.example.com
GET request
$ http POST https://api.example.com name=value
POST z form data
$ http POST https://api.example.com name := value
POST z JSON (:=)
$ http -a user:pass GET https://api.example.com
Basic auth
$ http -b token GET https://api.example.com
Bearer token
$ http -f PUT https://api.example.com file := @file.txt
Multipart upload
Flagi
| Flaga | Opis |
|---|---|
GET/POST/PUT/DELETE |
HTTP method |
key=value |
Form data |
key := value |
JSON data |
-a |
Basic auth (user:pass) |
-b |
Bearer token |
-f |
Form (multipart) |
-j |
JSON output |
-p headers |
Pokaż tylko headers |
-v |
Verbose |
--stream |
Stream (nie buforuj) |