pypi / requests
requests
What changed in requests 1 to 2, from its official release notes, upgrade guides and advisories. Also covers types-requests. Sources checked 2026-11-30.
11 breaking1 security3 new APIs and options3 behavior and defaults1 tooling8 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initrequests 218 changes
Breaking changes 6
The headers input type is back to Mapping to avoid invariance issues; users calling Request.headers.update() may need to narrow typing.
The input type for headers changed to MutableMapping.
None was removed from the Request.headers typing.
Response.reason changed from str | None to str.
Support for Python 3.9 was dropped following its end of support.
The utility now extracts contents to a non-deterministic location to prevent malicious file replacement. This affects applications that call it directly.
Security 1
Digest Auth hashing algorithms now pass usedforsecurity=False to clarify security considerations.
New APIs and options 1
Requests is adding inline types for typed code bases; the notes invite users to try them and report gaps or feedback.
Behavior and default changes 1
The accepted input type for json was widened from dict and list to Mapping and Sequence.
Tooling 1
Requests now provides inline types, replacing those provided by typeshed, with public API types intended to be compatible with mypy, pyright, and ty.
Fixes and other changes 8
Fixed detection of some bodies with custom __getattr__ implementations as Iterables.
Proxy bypass no longer performs greedy matching on no_proxy domains, following CPython's fix for bpo-39057.
Requests adds support for Python 3.15 based on beta1 and Python 3.14t, allowing downstream projects to test compatibility.
Response.history no longer contains a reference to itself, preventing accidental looping when traversing the history list.
Requests no longer incorrectly strips duplicate leading slashes in URI paths, addressing issues with specific presigned URLs; the full fix requires urllib3 2.7.0+.
Parsing of malformed Content-Type header values was fixed.
Errors for malformed header values are now more consistent.
Fixed malformed authentication being applied to Requests when a netrc entry is empty on Python 3.11+.
requests 19 changes
Breaking changes 5
All configuration is removed, so existing configuration will not be compatible with this release.
All hooks other than response are removed.
The Kerberos authentication helper is removed.
The OAuth authentication helper is removed.
Response.json() is callable rather than a property.
New APIs and options 2
Connection adapters are swappable and mountable, allowing developers to customize how connections are handled.
The release notes list /s/prefetch/stream as a change.
Behavior and default changes 2
Logging switches to the Python standard library logging system.
The ProcessedRequest chain is mutable.