README.rst 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. Requests: HTTP for Humans
  2. =========================
  3. .. image:: https://img.shields.io/pypi/v/requests.svg
  4. :target: https://pypi.python.org/pypi/requests
  5. .. image:: https://img.shields.io/pypi/dm/requests.svg
  6. :target: https://pypi.python.org/pypi/requests
  7. Requests is an Apache2 Licensed HTTP library, written in Python, for human
  8. beings.
  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. Things shouldn't be this way. Not in Python.
  15. .. code-block:: python
  16. >>> r = requests.get('https://api.github.com', auth=('user', 'pass'))
  17. >>> r.status_code
  18. 204
  19. >>> r.headers['content-type']
  20. 'application/json'
  21. >>> r.text
  22. ...
  23. See `the same code, without Requests <https://gist.github.com/973705>`_.
  24. Requests allow you to send HTTP/1.1 requests. You can add headers, form data,
  25. multipart files, and parameters with simple Python dictionaries, and access the
  26. response data in the same way. It's powered by httplib and `urllib3
  27. <https://github.com/shazow/urllib3>`_, but it does all the hard work and crazy
  28. hacks for you.
  29. Features
  30. --------
  31. - International Domains and URLs
  32. - Keep-Alive & Connection Pooling
  33. - Sessions with Cookie Persistence
  34. - Browser-style SSL Verification
  35. - Basic/Digest Authentication
  36. - Elegant Key/Value Cookies
  37. - Automatic Decompression
  38. - Unicode Response Bodies
  39. - Multipart File Uploads
  40. - Connection Timeouts
  41. - Thread-safety
  42. - HTTP(S) proxy support
  43. Installation
  44. ------------
  45. To install Requests, simply:
  46. .. code-block:: bash
  47. $ pip install requests
  48. Documentation
  49. -------------
  50. Documentation is available at http://docs.python-requests.org/.
  51. Contribute
  52. ----------
  53. #. 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.
  54. #. Fork `the repository`_ on GitHub to start making your changes to the **master** branch (or branch off of it).
  55. #. Write a test which shows that the bug was fixed or that the feature works as expected.
  56. #. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_.
  57. .. _`the repository`: http://github.com/kennethreitz/requests
  58. .. _AUTHORS: https://github.com/kennethreitz/requests/blob/master/AUTHORS.rst
  59. .. _Contributor Friendly: https://github.com/kennethreitz/requests/issues?direction=desc&labels=Contributor+Friendly&page=1&sort=updated&state=open