Merge branch 'develop' of https://github.com/honzajavorek/requests into develop
[platform/upstream/python-requests.git] / README.rst
1 Requests: HTTP for Humans
2 =========================
3
4 .. image:: https://secure.travis-ci.org/kennethreitz/requests.png?branch=develop
5
6 Requests is an ISC Licensed HTTP library, written in Python, for human
7 beings.
8
9 Most existing Python modules for sending HTTP requests are extremely
10 verbose and cumbersome. Python's builtin urllib2 module provides most of
11 the HTTP capabilities you should need, but the api is thoroughly broken.
12 It requires an enormous amount of work (even method overrides) to
13 perform the simplest of tasks.
14
15 Things shouldn't be this way. Not in Python.
16
17 ::
18
19     >>> r = requests.get('https://api.github.com', auth=('user', 'pass'))
20     >>> r.status_code
21     204
22     >>> r.headers['content-type']
23     'application/json'
24     >>> r.text
25     ...
26
27 See `the same code, without Requests <https://gist.github.com/973705>`_.
28
29 Requests allow you to send  **HEAD**, **GET**, **POST**, **PUT**,
30 **PATCH**, and **DELETE** HTTP requests. You can add headers, form data,
31 multipart files, and parameters with simple Python dictionaries, and access the
32 response data in the same way. It's powered by httplib and `urllib3
33 <https://github.com/shazow/urllib3>`_, but it does all the hard work and crazy
34 hacks for you.
35
36
37 Features
38 --------
39
40 - International Domains and URLs
41 - Keep-Alive & Connection Pooling
42 - Sessions with Cookie Persistence
43 - Browser-style SSL Verification
44 - Basic/Digest Authentication
45 - Elegant Key/Value Cookies
46 - Automatic Decompression
47 - Unicode Response Bodies
48 - Multipart File Uploads
49 - Connection Timeouts
50
51
52 Installation
53 ------------
54
55 To install requests, simply: ::
56
57     $ pip install requests
58
59 Or, if you absolutely must: ::
60
61     $ easy_install requests
62
63 But, you really shouldn't do that.
64
65
66
67 Contribute
68 ----------
69
70 #. 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.
71 #. Fork `the repository`_ on Github to start making your changes to the **develop** branch (or branch off of it).
72 #. Write a test which shows that the bug was fixed or that the feature works as expected.
73 #. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_.
74
75 .. _`the repository`: http://github.com/kennethreitz/requests
76 .. _AUTHORS: http://github.com/kennethreitz/requests/blob/master/AUTHORS