http

user-friendly HTTP client

TLDR

GET request
$ http [https://api.example.com/users]
POST with JSON
$ http POST [url] name=value
POST with form data
$ http --form POST [url] field=value
Custom headers
$ http [url] Authorization:"Bearer [token]"
Download file
$ http --download [url]
Authenticated request
$ http --auth [user]:[password] [url]
Verbose output
$ http --verbose [url]
Use a named session
$ http --session=[name] [url]

SYNOPSIS

http [options] [method] url [data]

DESCRIPTION

HTTPie (http) is a user-friendly HTTP client. It provides intuitive syntax, colorized output, and JSON support for API interaction.The tool simplifies making HTTP requests from the command line. It automatically formats responses and supports sessions and authentication.

PARAMETERS

METHOD

HTTP method (GET, POST, PUT, DELETE).
URL
Request URL.
DATA
Request data (key=value pairs).
-d, --download
Download file.
-f, --form
Form encoded data.
-j, --json
JSON data.
-v, --verbose
Verbose output.
-o, --output FILE
Output file.
-a, --auth USER:PASS
Basic or digest authentication credentials.
-A, --auth-type TYPE
Authentication type: basic, digest, bearer.
--session NAME
Create or reuse a named session for cookies and headers.
-p, --print FLAGS
Control output: H (request headers), B (request body), h (response headers), b (response body).
--pretty STYLE
Output formatting: all, colors, format, none.
--verify CERT
SSL certificate verification. Use no to skip.
--proxy PROTOCOL:URL
Use a proxy for requests.
--follow
Follow HTTP redirects.
--help
Display help information.

INSTALL

sudo dnf install httpie
sudo pacman -S httpie
sudo apk add httpie
sudo zypper install httpie
brew install httpie
nix profile install nixpkgs#httpie

CAVEATS

Python package. Different from curl syntax. JSON by default.

HISTORY

HTTPie was created by Jakub Roztocil as a more user-friendly alternative to curl for API testing.

SEE ALSO

curl(1), wget(1), https(1), xh(1), curlie(1)