pypi / requests
requests
What changed in requests 2, from its official release notes, upgrade guides and advisories. Also covers types-requests. Sources checked 2026-10-18.
6 breaking2 security1 new APIs and options1 behavior and defaults1 tooling8 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initrequests 219 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 2
Digest Auth hashing algorithms now pass usedforsecurity=False to clarify security considerations.
Requests has Insecure Temp File Reuse in its extract_zipped_paths() utility function
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+.