# Feature catalog — psf/requests

> Canonical page: https://codevetter.com/unpack/requests/feature-catalog

# Feature catalog — psf/requests

Scanned commit 611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60 (2026-09-21). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Every user-facing feature is a Python API, not a route or command. The catalog splits into: the seven HTTP verb helpers and their `Session` methods; request-construction features (params, form/JSON/multipart/streamed bodies, file uploads, IDNA hostnames); response-consumption features (`.text` with charset auto-detection, `.json()` with UTF-BOM sniffing, `.iter_content`/`.iter_lines` streaming, `.links` header parsing, `.raise_for_status`); and connection features (pooling, redirects, cookie persistence, proxy resolution including SOCKS, TLS verification and mTLS client certs, netrc auth, digest auth). Two auxiliary surfaces exist: `python -m requests.help` prints a JSON environment report for bug filing, and `python -m requests.certs` prints the CA bundle path.
- Seven verb helpers are exposed at module level and mirrored as `Session` methods; `head()` uniquely defaults `allow_redirects` to `False` at both levels while `get`/`options` default it to `True`. — [src/requests/api.py#L100-L110](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/api.py#L100-L110) [src/requests/sessions.py#L653-L680](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/sessions.py#L653-L680)
- Request bodies support four distinct shapes decided in `prepare_body`: JSON via `complexjson.dumps(json, allow_nan=False)` → `application/json`; multipart via `_encode_files`; form-encoding via `_encode_params` → `application/x-www-form-urlencoded`; and streamed iterables/file objects that set `Transfer-Encoding: chunked` when length is unknown. — [src/requests/models.py#L576-L651](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/models.py#L576-L651)
- Multipart uploads accept 2-, 3-, and 4-tuples (`filename, fileobj`, `+content_type`, `+custom_headers`) and are assembled into urllib3 `RequestField` objects by `encode_multipart_formdata`. — [src/requests/models.py#L183-L250](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/models.py#L183-L250) [src/requests/api.py#L36-L40](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/api.py#L36-L40)
- Streaming bodies and file uploads are mutually exclusive — combining them raises `NotImplementedError("Streamed bodies and files are mutually exclusive.")`. — [src/requests/models.py#L622-L626](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/models.py#L622-L626)
- Internationalised domains are supported by `_get_idna_encoded_host()`, which applies `idna.encode(host, uts46=True)` for any non-ASCII host and raises `InvalidURL("URL has an invalid label.")` on failure. — [src/requests/models.py#L474-L482](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/models.py#L474-L482) [src/requests/models.py#L525-L534](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/models.py#L525-L534)
- `Response.text` decodes using the header-declared charset, falling back to `apparent_encoding` (charset_normalizer or chardet), and finally to `utf-8` with `errors="replace"` if no detection library is installed. — [src/requests/models.py#L1054-L1090](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/models.py#L1054-L1090) [src/requests/models.py#L897-L904](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/models.py#L897-L904)
- `Response.json()` sniffs UTF-8/16/32 via `guess_json_utf()` when no encoding is declared and the body exceeds 3 bytes, and normalises every decode failure into `requests.exceptions.JSONDecodeError`. — [src/requests/models.py#L1091-L1125](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/models.py#L1091-L1125) [src/requests/utils.py#L1008](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/utils.py#L1008)
- Streaming download is offered by `iter_content(chunk_size, decode_unicode)` and the line-oriented `iter_lines(delimiter=...)`; re-iterating a consumed non-streamed response raises `StreamConsumedError`. — [src/requests/models.py#L914-L978](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/models.py#L914-L978) [src/requests/models.py#L994-L1033](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/models.py#L994-L1033)
- Pagination via RFC 5988 is supported by `Response.links`, which parses the `Link` header through `parse_header_links()` and keys results by `rel` (falling back to `url`). — [src/requests/models.py#L1127-L1142](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/models.py#L1127-L1142) [src/requests/utils.py#L965](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/utils.py#L965)
- `requests.codes` is a `LookupDict` supporting attribute and item access with multiple aliases per code — including the joke aliases `codes['\\o/']` and `codes['✓']` for 200 — generated by `_init()` which also appends the full table to the module docstring. — [src/requests/status_codes.py#L22-L31](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/status_codes.py#L22-L31) [src/requests/status_codes.py#L109-L128](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/status_codes.py#L109-L128) [src/requests/structures.py#L96-L131](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/structures.py#L96-L131)
- Three auth handlers ship: `HTTPBasicAuth`, `HTTPProxyAuth` (same header under `Proxy-Authorization`), and `HTTPDigestAuth` supporting MD5, MD5-SESS, SHA, SHA-256 and SHA-512 with `qop=auth`. — [src/requests/auth.py#L85-L122](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/auth.py#L85-L122) [src/requests/auth.py#L157-L215](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/auth.py#L157-L215)
- `.netrc` credentials are honoured automatically when `trust_env` is true, checked at `$NETRC` if set otherwise `~/.netrc` and `~/_netrc`, and re-applied on cross-host redirects by `rebuild_auth`. — [src/requests/utils.py#L231-L280](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/utils.py#L231-L280) [src/requests/sessions.py#L309-L332](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/sessions.py#L309-L332)
- SOCKS proxy support is optional: `proxy_manager_for()` routes `socks*` proxies to `SOCKSProxyManager`, and a stub raising `InvalidSchema("Missing dependencies for SOCKS support.")` is installed when PySocks is absent. — [src/requests/adapters.py#L62-L68](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/adapters.py#L62-L68) [src/requests/adapters.py#L269-L305](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/adapters.py#L269-L305) [pyproject.toml#L52](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/pyproject.toml#L52)
- `python -m requests.help` (i.e. `help.main()`) prints a sorted, indented JSON bug-report blob covering platform, interpreter implementation, system OpenSSL version, urllib3, chardet/charset_normalizer, pyOpenSSL, cryptography, idna and requests versions. — [src/requests/help.py#L67-L132](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/help.py#L67-L132) [tests/test_help.py](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/tests/test_help.py)
- Sessions are picklable: `__getstate__`/`__setstate__` serialise the 12 attributes listed in `Session.__attrs__`, while `HTTPAdapter.__setstate__` rebuilds the unpicklable `PoolManager` by re-calling `init_poolmanager`. — [src/requests/sessions.py#L427-L440](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/sessions.py#L427-L440) [src/requests/sessions.py#L895-L902](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/sessions.py#L895-L902) [src/requests/adapters.py#L223-L238](https://github.com/psf/requests/blob/611c6162cbc4ac2020a2f91c7cfa4f3abf9bbb60/src/requests/adapters.py#L223-L238)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
