LinuxCommandLibrary

httpie

user-friendly HTTP client for the command line

TLDR

Simple GET request

$ http [https://api.example.com/users]
copy
POST with JSON
$ http POST [https://api.example.com/users] name=John age:=30
copy
POST form data
$ http -f POST [url] name=John email=john@example.com
copy
Add custom header
$ http [url] Authorization:"Bearer token"
copy
Download file
$ http --download [https://example.com/file.zip]
copy
Follow redirects
$ http --follow [url]
copy
Show only headers
$ http --headers [url]
copy

SYNOPSIS

http [options] [method] url [items...]

DESCRIPTION

HTTPie is a user-friendly HTTP client for the command line. It provides intuitive syntax, colored output, and sensible defaults for API testing and debugging.

PARAMETERS

method

HTTP method (GET, POST, PUT, DELETE, etc.).
--json, -j
JSON data (default).
--form, -f
Form data.
--headers, -h
Print only headers.
--body, -b
Print only body.
--download, -d
Download file.
--follow, -F
Follow redirects.
--auth, -a user:pass
Basic authentication.
--auth-type type
Auth type: basic, digest.
--session name
Named session for cookies/auth.
--offline
Build request offline.

ITEM TYPES

$ key=value      String data
key:=value     Raw JSON
key==value     Query parameter
Header:value   HTTP header
@file          File upload
copy

CAVEATS

Requires Python. Syntax differs from curl. Large responses may be slow to colorize.

HISTORY

HTTPie was created by Jakub Roztočil in 2012 as a more user-friendly alternative to curl for interacting with HTTP APIs.

SEE ALSO

curl(1), wget(1), xh(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community