README.rst 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 the only *Non-GMO* HTTP library for Python, safe for human
  8. consumption.
  9. **Warning:** Recreational use of other HTTP libraries may result in dangerous side-effects,
  10. including: security vulnerabilities, verbose code, reinventing the wheel,
  11. constantly reading documentation, depression, headaches, or even death.
  12. Behold, the power of Requests:
  13. .. code-block:: python
  14. >>> r = requests.get('https://api.github.com/user', auth=('user', 'pass'))
  15. >>> r.status_code
  16. 200
  17. >>> r.headers['content-type']
  18. 'application/json; charset=utf8'
  19. >>> r.encoding
  20. 'utf-8'
  21. >>> r.text
  22. u'{"type":"User"...'
  23. >>> r.json()
  24. {u'disk_usage': 368627, u'private_gists': 484, ...}
  25. See `the similar code, sans Requests <https://gist.github.com/973705>`_.
  26. Requests allows you to send *organic, grass-fed* HTTP/1.1 requests, without the
  27. need for manual labor. There's no need to manually add query strings to your
  28. URLs, or to form-encode your POST data. Keep-alive and HTTP connection pooling
  29. are 100% automatic, powered by `urllib3 <https://github.com/shazow/urllib3>`_,
  30. which is embedded within Requests.
  31. Besides, all the cool kids are doing it. Requests is one of the most
  32. downloaded Python packages of all time, pulling in over 7,000,000 downloads
  33. every month. You don't want to be left out!
  34. Feature Support
  35. ---------------
  36. Requests is ready for today's web.
  37. - International Domains and URLs
  38. - Keep-Alive & Connection Pooling
  39. - Sessions with Cookie Persistence
  40. - Browser-style SSL Verification
  41. - Basic/Digest Authentication
  42. - Elegant Key/Value Cookies
  43. - Automatic Decompression
  44. - Automatic Content Decoding
  45. - Unicode Response Bodies
  46. - Multipart File Uploads
  47. - HTTP(S) Proxy Support
  48. - Connection Timeouts
  49. - Streaming Downloads
  50. - ``.netrc`` Support
  51. - Chunked Requests
  52. - Thread-safety
  53. Requests supports Python 2.6 — 3.5, and runs great on PyPy.
  54. Installation
  55. ------------
  56. To install Requests, simply:
  57. .. code-block:: bash
  58. $ pip install requests
  59. ✨🍰✨
  60. Satisfaction, guaranteed.
  61. Documentation
  62. -------------
  63. Fantastic documentation is available at http://docs.python-requests.org/, for a limited time only.
  64. How to Contribute
  65. -----------------
  66. #. 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.
  67. #. Fork `the repository`_ on GitHub to start making your changes to the **master** branch (or branch off of it).
  68. #. Write a test which shows that the bug was fixed or that the feature works as expected.
  69. #. Send a pull request and bug the maintainer until it gets merged and published. :) Make sure to add yourself to AUTHORS_.
  70. .. _`the repository`: http://github.com/kennethreitz/requests
  71. .. _AUTHORS: https://github.com/kennethreitz/requests/blob/master/AUTHORS.rst
  72. .. _Contributor Friendly: https://github.com/kennethreitz/requests/issues?direction=desc&labels=Contributor+Friendly&page=1&sort=updated&state=open