README.rst
This file
Path
README.rst
82 lines · 2.5 KiB
Last changed by
Merge pull request #1007 from passy/patch-1Kenneth Reitzbefore adoption7ef6b6b
History of this fileTake it
The walk stopped after 200 commits: lines older than 511b139 point at it.
Merge pull request #676 from apotheos/developKenneth Reitzbefore adoption511b139
lines 1–4why, one step back1Requests: HTTP for Humans2=========================34Merge pull request #1007 from passy/patch-1Kenneth Reitzbefore adoption7ef6b6b
lines 5–6why, one step back5.. image:: https://travis-ci.org/kennethreitz/requests.png?branch=master6 :target: https://travis-ci.org/kennethreitz/requestsMerge pull request #676 from apotheos/developKenneth Reitzbefore adoption511b139
line 7why, one step back7Merge remote-tracking branch 'origin/master'Kenneth Reitzbefore adoption7e47d5e
line 8why, one step back8Requests is an Apache2 Licensed HTTP library, written in Python, for humanMerge pull request #676 from apotheos/developKenneth Reitzbefore adoption511b139
lines 9–18why, one step back9beings.1011Most existing Python modules for sending HTTP requests are extremely12verbose and cumbersome. Python's builtin urllib2 module provides most of13the HTTP capabilities you should need, but the api is thoroughly broken.14It requires an enormous amount of work (even method overrides) to15perform the simplest of tasks.1617Things shouldn't be this way. Not in Python.18Merge remote-tracking branch 'origin/master'Kenneth Reitzbefore adoption7e47d5e
line 19why, one step back19.. code-block:: pyconMerge pull request #676 from apotheos/developKenneth Reitzbefore adoption511b139
lines 20–56why, one step back2021 >>> r = requests.get('https://api.github.com', auth=('user', 'pass'))22 >>> r.status_code23 20424 >>> r.headers['content-type']25 'application/json'26 >>> r.text27 ...2829See `the same code, without Requests <https://gist.github.com/973705>`_.3031Requests allow you to send HTTP/1.1 requests. You can add headers, form data,32multipart files, and parameters with simple Python dictionaries, and access the33response data in the same way. It's powered by httplib and `urllib334<https://github.com/shazow/urllib3>`_, but it does all the hard work and crazy35hacks for you.363738Features39--------4041- International Domains and URLs42- Keep-Alive & Connection Pooling43- Sessions with Cookie Persistence44- Browser-style SSL Verification45- Basic/Digest Authentication46- Elegant Key/Value Cookies47- Automatic Decompression48- Unicode Response Bodies49- Multipart File Uploads50- Connection Timeouts51- Thread-safety525354Installation55------------56Merge remote-tracking branch 'origin/master'Kenneth Reitzbefore adoption7e47d5e
line 57why, one step back57To install requests, simply:Merge pull request #676 from apotheos/developKenneth Reitzbefore adoption511b139
line 58why, one step back58Merge remote-tracking branch 'origin/master'Kenneth Reitzbefore adoption7e47d5e
lines 59–60why, one step back59.. code-block:: bash60Merge pull request #676 from apotheos/developKenneth Reitzbefore adoption511b139
lines 61–62why, one step back61 $ pip install requests62Merge remote-tracking branch 'origin/master'Kenneth Reitzbefore adoption7e47d5e
lines 63–65why, one step back63Or, if you absolutely must:6465.. code-block:: bashMerge pull request #676 from apotheos/developKenneth Reitzbefore adoption511b139
lines 66–81why, one step back6667 $ easy_install requests6869But, you really shouldn't do that.70717273Contribute74----------7576#. 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.77#. Fork `the repository`_ on Github to start making your changes to the **develop** branch (or branch off of it).78#. Write a test which shows that the bug was fixed or that the feature works as expected.79#. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_.8081.. _`the repository`: http://github.com/kennethreitz/requestsMerge remote-tracking branch 'origin/master'Kenneth Reitzbefore adoptionb60b11e
line 82why, one step back82.. _AUTHORS: https://github.com/kennethreitz/requests/blob/master/AUTHORS.rst