Simplicity at its finest

All hooks except response removed, which was the only one in serious use.

Removal of the magic Response.json property. Replaced with a method.

Change of prefetch argument to stream, to emphasize its purpose.

Sessions now provide all persistience, connections, and configuration. No magic.

Session creation no longer has any options. You can modify a session yourself.

Removal of esoteric ISC license. Replaced with Apache 2.0.

There are no more global configuration defaults.

Simplicity is always better than functionality. — Pieter Hintjens

The entire codebase has been rearchitected. For example, Requests no longer has anyconfiguration.

Previously, there was a configuration mode called encode_uri, which gave the user the ability to fully disable Requests' (rather advanced) URI requoting. This helped two or three people get around some server-specific issues.

Connection Adapters

So, how do we send this new PreparedRequest object? Before, you'd call a magicalRequest.send method, which would run about 2000 lines of complex, hard-to-follow, code.

Now, you can send your PreparedRequest through a session's connection. Of course, Requests comes with a perfect adapter already: HTTPAdapter. It seamlessly supports connection pooling, proxies, timeouts, etc. Just like you know and love :)

>>> s = requests.Session()
>>> s.send(prep)
<Response [200]>

No need for a session? Send it straight through your own connection. Trade them like Pokémon cards!

A Connection Adapter is a simple class that lets you declare a connection, its persitience, and how to turn a PreparedRequest into a Response. You can register Connection Adapters in a Session, and requests will automatically be sent through the proper adapter.

For example, we could now send requests through a theoretical WSGIAdapter: