Not Logged In

requests 2.4.0

Requests is an Apache2 Licensed HTTP library, written in Python, for human
beings.

Most existing Python modules for sending HTTP requests are extremely
verbose and cumbersome. Python’s builtin urllib2 module provides most of
the HTTP capabilities you should need, but the api is thoroughly broken.
It requires an enormous amount of work (even method overrides) to
perform the simplest of tasks.

Requests allow you to send HTTP/1.1 requests. You can add headers, form data,
multipart files, and parameters with simple Python dictionaries, and access the
response data in the same way. It’s powered by httplib and urllib3, but it does all the hard work and crazy
hacks for you.

Features

International Domains and URLs

Keep-Alive & Connection Pooling

Sessions with Cookie Persistence

Browser-style SSL Verification

Basic/Digest Authentication

Elegant Key/Value Cookies

Automatic Decompression

Unicode Response Bodies

Multipart File Uploads

Connection Timeouts

Thread-safety

HTTP(S) proxy support

Installation

To install Requests, simply:

$ pip install requests

Documentation

Contribute

Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug. There is a Contributor Friendly tag for issues that should be ideal for people who are not very familiar with the codebase yet.

If you feel uncomfortable or uncertain about an issue or your changes, feel free to email @sigmavirus24 and he will happily help you via email, Skype, remote pairing or whatever you are comfortable with.

Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).

Write a test which shows that the bug was fixed or that the feature works as expected.

Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS.

Release History

2.4.0 (2014-08-29)

Behavioral Changes

Connection: keep-alive header is now sent automatically.

Improvements

Support for connect timeouts! Timeout now accepts a tuple (connect, read) which is used to set individual connect and read timeouts.

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.

1.2.3 (2013-05-25)

Simple packaging fix

1.2.2 (2013-05-23)

Simple packaging fix

1.2.1 (2013-05-20)

301 and 302 redirects now change the verb to GET for all verbs, not just
POST, improving browser compatibility.

Python 3.3.2 compatibility

Always percent-encode location headers

Fix connection adapter matching to be most-specific first

new argument to the default connection adapter for passing a block argument

prevent a KeyError when there’s no link headers

1.2.0 (2013-03-31)

Fixed cookies on sessions and on requests

Significantly change how hooks are dispatched - hooks now receive all the
arguments specified by the user when making a request so hooks can make a
secondary request with the same parameters. This is especially necessary for
authentication handler authors

certifi support was removed

Fixed bug where using OAuth 1 with body signature_type sent no data

Major proxy work thanks to @Lukasa including parsing of proxy authentication
from the proxy url

Fix DigestAuth handling too many 401s

Update vendored urllib3 to include SSL bug fixes

Allow keyword arguments to be passed to json.loads() via the
Response.json() method

Don’t send Content-Length header by default on GET or HEAD
requests

Add elapsed attribute to Response objects to time how long a request
took.

Fix RequestsCookieJar

Sessions and Adapters are now picklable, i.e., can be used with the
multiprocessing library

Update charade to version 1.0.3

The change in how hooks are dispatched will likely cause a great deal of
issues.

1.1.0 (2013-01-10)

CHUNKED REQUESTS

Support for iterable response bodies

Assume servers persist redirect params

Allow explicit content types to be specified for file data

Make merge_kwargs case-insensitive when looking up keys

1.0.3 (2012-12-18)

Fix file upload encoding bug

Fix cookie behavior

1.0.2 (2012-12-17)

Proxy fix for HTTPAdapter.

1.0.1 (2012-12-17)

Cert verification exception bug.

Proxy fix for HTTPAdapter.

1.0.0 (2012-12-17)

Massive Refactor and Simplification

Switch to Apache 2.0 license

Swappable Connection Adapters

Mountable Connection Adapters

Mutable ProcessedRequest chain

/s/prefetch/stream

Removal of all configuration

Standard library logging

Make Response.json() callable, not property.

Usage of new charade project, which provides python 2 and 3 simultaneous chardet.