LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

http

user-friendly HTTP client

TLDR

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

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.

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)

Copied to clipboard
Kai