CodeVetter · Repo Unpack · Feature catalog
encode/httpx
The user-facing surface consists of library APIs and a single HTTP request CLI. Library callers can choose convenience helpers or reusable clients, customize request construction, and consume buffered or streaming responses. Protocol, proxy, authentication, and in-process application integrations share the client model. The following eight groups describe capabilities supported by the inspected implementation.
- The top-level API exports get, options, head, post, put, patch, delete, request, and stream; generic request accepts body content, form data, files, JSON, query parameters, headers, cookies, and authentication.
- Reusable clients combine default headers, query parameters, and cookies with request values, append relative paths to base_url, retain cookies, and offer synchronous or awaited request methods.
- Response offers decoded bytes, text, JSON, links, cookies, HTTP metadata, status predicates, and explicit raise_for_status(); the latter raises for any non-success response and requires an associated request.
- Uploads support raw strings/bytes, sync or async byte iterables, URL-encoded forms, compact UTF-8 JSON, and multipart files with optional filename, content type, and per-part headers.
- Streaming responses expose raw bytes, decompressed bytes, incremental text and lines, plus corresponding async methods; gzip/deflate are built in and Brotli/Zstandard decoders depend on installed extras.
- Authentication supports Basic, Digest, explicit NetRCAuth, callable request transforms, and custom Auth flows. Redirect following is optional, with history and next_request available for automatic or manual navigation.
- Transport configuration exposes HTTP/1 and opt-in HTTP/2, HTTP/HTTPS/SOCKS proxies, TLS contexts, four timeout categories, connection limits, socket options, local addresses, Unix sockets, and connection-error retries; ASGI/WSGI transports call local apps.
- The CLI accepts URL, method, body/query/header/cookie/auth options, proxy, timeout, redirects, TLS verification toggle, HTTP/2, download destination, and verbose tracing; it renders text/JSON or a binary-size summary and exits according to response success.