httpx2
Command-line HTTP client from the HTTPX2 Python library
TLDR
SYNOPSIS
httpx2 URL [options]
DESCRIPTION
httpx2 is the optional command-line client shipped with HTTPX2, Pydantic's maintained continuation of the Python httpx library. It is not ProjectDiscovery's httpx probe toolkit (documented as httpx in this library).Install the CLI extra, which pulls in click, rich, and pygments:
PARAMETERS
-m METHOD, --method METHOD
HTTP method: GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD, QUERY. Default GET, or POST if a request body is included.-p NAME VALUE, --params NAME VALUE
Query parameter. Repeatable.-c TEXT, --content TEXT
Raw request body.-d NAME VALUE, --data NAME VALUE
Form field in the request body. Repeatable.-f NAME FILE, --files NAME FILE
Multipart file field. Repeatable.-j TEXT, --json TEXT
JSON request body (must be valid JSON).-h NAME VALUE, --headers NAME VALUE
Extra request header. Repeatable.--cookies NAME VALUE
Cookie. Repeatable.--auth USER PASS
HTTP basic auth. Use - as the password to prompt. --verbose prints the Authorization header (reversible encoding).--proxy URL
Proxy URL for the request.--timeout FLOAT
Network timeout in seconds (default 5.0).--follow-redirects
Follow HTTP redirects.--no-verify
Disable TLS certificate verification.--http2
Prefer HTTP/2 when the server supports it. Requires pip install 'httpx2[http2]'.--download FILE
Write the response body to FILE instead of printing it.-v, --verbose
Print the request (and TLS details) as well as the response.--help
Show help and exit.
INSTALL
CAVEATS
The binary name httpx2 does not collide with ProjectDiscovery httpx, but mixing the two in scripts is easy if you type the wrong command.--http2 needs the optional h2 extra. SOCKS proxies and Brotli/Zstd decoding are also optional extras (httpx2[socks], httpx2[brotli], httpx2[zstd]), not CLI flags.Requires Python 3.10+. Pair options (--headers, --params, --data, --auth, --cookies, --files) take two argv tokens, not Name:Value as in HTTPie.
HISTORY
HTTPX was created by Tom Christie (encode/httpx). With upstream activity slowing, Pydantic forked stewardship as HTTPX2 (BSD-3-Clause) so the library keeps receiving security and maintenance updates. The CLI command was renamed from httpx to httpx2 to match the package.
