requests v2.0.0 Release Notes
Release Date: 2013-09-24 // over 10 years ago-
API Changes:
- Keys in the Headers dictionary are now native strings on all Python versions, i.e. bytestrings on Python 2, unicode on Python 3.
- Proxy URLs now must have an explicit scheme. A
MissingSchema
exception will be raised if they don't. - Timeouts now apply to read time if
Stream=False
. -
RequestException
is now a subclass ofIOError
, notRuntimeError
. - Added new method to
PreparedRequest
objects:PreparedRequest.copy()
. - โก๏ธ Added new method to
Session
objects:Session.update_request()
. This method updates aRequest
object with the data (e.g. cookies) stored on theSession
. - Added new method to
Session
objects:Session.prepare_request()
. This method updates and prepares aRequest
object, and returns the correspondingPreparedRequest
object. - Added new method to
HTTPAdapter
objects:HTTPAdapter.proxy_headers()
. This should not be called directly, but improves the subclass interface. -
httplib.IncompleteRead
exceptions caused by incorrect chunked encoding will now raise a RequestsChunkedEncodingError
instead. - Invalid percent-escape sequences now cause a Requests
InvalidURL
exception to be raised. - HTTP 208 no longer uses reason phrase
"im_used"
. Correctly uses"already_reported"
. - HTTP 226 reason added (
"im_used"
).
๐ Bugfixes:
- ๐ Vastly improved proxy support, including the CONNECT verb. Special thanks to the many contributors who worked towards this improvement.
- Cookies are now properly managed when 401 authentication responses are received.
- ๐ Chunked encoding fixes.
- ๐ Support for mixed case schemes.
- ๐ Better handling of streaming downloads.
- Retrieve environment proxies from more locations.
- ๐ Minor cookies fixes.
- Improved redirect behaviour.
- Improved streaming behaviour, particularly for compressed data.
- Miscellaneous small Python 3 text encoding bugs.
-
.netrc
no longer overrides explicit auth. - Cookies set by hooks are now correctly persisted on Sessions.
- Fix problem with cookies that specify port numbers in their host field.
-
BytesIO
can be used to perform streaming uploads. - ๐ More generous parsing of the
no_proxy
environment variable. - Non-string objects can be passed in data values alongside files.