Skip to content
Myr

massive documentation update

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 3bc9a18 · Browse files · 7 files+159 added−103 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

7 files+159 added−103 removed

  • other:+159 added−103 removed

7 files+159 added−103 removed

added:docs/community/faq.rst+43 added
1.. _faq:23Frequently Asked Questions4==========================56This part of the documentation covers common questions about Requests.78Why not Httplib2?9-----------------1011Chris Adams gave an excellent summary on12`Hacker News <http://news.ycombinator.com/item?id=2884406>`_:1314 httplib2 is part of why you should use requests: it's far more respectable15 as a client but not as well documented and it still takes way too much code16 for basic operations. I appreciate what httplib2 is trying to do, that17 there's a ton of hard low-level annoyances in building a modern HTTP18 client, but really, just use requests instead. Kenneth Reitz is very19 motivated and he gets the degree to which simple things should be simple20 whereas httplib2 feels more like an academic exercise than something21 people should use to build production systems[1].2223 Disclosure: I'm listed in the requests AUTHORS file but can claim credit24 for, oh, about 0.0001% of the awesomeness.2526 1. http://code.google.com/p/httplib2/issues/detail?id=96 is a good example:27 an annoying bug which affect many people, there was a fix available for28 months, which worked great when I applied it in a fork and pounded a couple29 TB of data through it, but it took over a year to make it into trunk and30 even longer to make it onto PyPI where any other project which required "31 httplib2" would get the working version.323334Python 3 Support?35-----------------3637It's on the way.383940Keep-alive Support?41-------------------4243It's on the way.
added:docs/community/support.rst+37 added
1.. _support:23Support4=======56If you have a questions or issues about Requests, there are serveral options:78Send a Tweet9------------1011If your question is less than 140 characters, feel free to send a tweet to12`@kennethreitz <http://twitter.com/kennethreitz>`_.131415File an Issue16-------------1718If you notice some unexpected behavior in Requests, or want to see support19for a new feature,20`file an issue on GitHub <https://github.com/kennethreitz/requests/issues>`_.212223E-mail24------2526I'm more than happy to answer any personal or in-depth questions about27Requests. Feel free to email28`requests@kennethreitz.com <mailto:requests@kennethreitz.com>`_.293031IRC32---3334The official Freenode channel for Requests is35`#python-requests <irc://irc.freenode.net/python-requests>`_3637I'm also available as **kennethreitz** on Freenode.
added:docs/community/updates.rst+31 added
1.. _updates:23Updates4=======56If you'd like to stay up to date on the community and development of Requests,7there are serveral options:89GitHub10------1112The best way to track the development of Requests is through13`the GitHub repo <https://github.com/kennethreitz/requests>`_.1415Twitter16-------1718I often tweet about new features and releases of Requests.1920Follow `@kennethreitz <https://twitter.com/kennethreitz>`_ for updates.21222324Mailing List25------------2627There's a low-volume mailing list for Requests. To subscribe to the28mailing list, send an email to29`requests@librelist.org <mailto:requests@librelist.org>`_.3031
added:docs/dev/authors.rst+5 added
1Authors2=======345.. include:: ../../AUTHORS
deleted:docs/user/faq.rst-43 removed
1.. _faq:23Frequently Asked Questions4==========================56This part of the documentation covers common questions about Requests.78Why not Httplib2?9-----------------1011Chris Adams gave an excellent summary on12`Hacker News <http://news.ycombinator.com/item?id=2884406>`_:1314 httplib2 is part of why you should use requests: it's far more respectable15 as a client but not as well documented and it still takes way too much code16 for basic operations. I appreciate what httplib2 is trying to do, that17 there's a ton of hard low-level annoyances in building a modern HTTP18 client, but really, just use requests instead. Kenneth Reitz is very19 motivated and he gets the degree to which simple things should be simple20 whereas httplib2 feels more like an academic exercise than something21 people should use to build production systems[1].2223 Disclosure: I'm listed in the requests AUTHORS file but can claim credit24 for, oh, about 0.0001% of the awesomeness.2526 1. http://code.google.com/p/httplib2/issues/detail?id=96 is a good example:27 an annoying bug which affect many people, there was a fix available for28 months, which worked great when I applied it in a fork and pounded a couple29 TB of data through it, but it took over a year to make it into trunk and30 even longer to make it onto PyPI where any other project which required "31 httplib2" would get the working version.323334Python 3 Support?35-----------------3637It's on the way.383940Keep-alive Support?41-------------------4243It's on the way.
modified:docs/user/quickstart.rst+28 added-58 removed
1Feature Overview2================1.. _quickstart:24Requests is designed to solve a 90% use case — making simple requests. While most5HTTP libraries are extremely extensible, they often attempt to support the entire HTTP Spec.6This often leads to extremely messy and cumbersome APIs, as is the case with urllib2. Requests abandons support for edge-cases, and focuses on the essentials.789.. _features:1011Requests Can:12-------------1314- Make **GET**, **POST**, **PUT**, **DELETE**, and **HEAD** requests.15- Handle HTTP and HTTPS Requests16- Add Request headers (with a simple dictionary)17- URLEncode your Form Data (with a simple dictionary)18- Add Multi-part File Uploads (with a simple dictionary)19- Handle CookieJars (with a single parameter)20- Add HTTP Authentication (with a single parameter)21- Handle redirects (with history)22- Automatically decompress GZip'd responses23- Support Unicode URLs24- Gracefully timeout25- Interface with Eventlet & Gevent262728Requests Can't:29---------------3031- Handle Caching32- Handle Keep-Alives33343Quickstart4==========56.. module:: requests739GET Request40-----------8Eager to get started? This page gives a good introduction in how to get started with Requests. This assumes you already have Tablib installed. If you do not, head over to the :ref:`Installation <install>` section.910First, make sure that:1143Adding Parameters44-----------------12* Tablib is :ref:`installed <install>`13* Tablib is :ref:`up-to-date <updates>`141516Lets gets started with some simple use cases and examples.1748Adding Headers49--------------18515253HTTP Basic Auth54---------------555657Tracking Redirects19Make a GET Request20------------------2122Making a standard request with Requests is very simple.2324Let's get GitHub's public timeline ::2526 r = requests.get('https://github.com/timeline.json')2763HTTP POST (Form Data)64---------------------28Now, we have a :class:`Response` object. We can get all the information29we need from this.303167HTTP POST (Binary Data)68-----------------------32Response Content33----------------3435We can read the content of the server's response::3671HTTP POST (Multipart Files)72---------------------------37 >>> r.content38 '[{"repository":{"open_issues":0,"url":"https://github.com/...394075HTTP PUT76--------4142Response Status Codes43---------------------4479HTTP DELETE80-----------45We can check the response status code::4647 >>> r.status_code48 2004983HTTP HEAD84---------50Requests also comes with a built-in status code lookup object for easy51reference::5253 >>> r.status_code == requests.codes.ok54 True
modified:docs/index.rst+15 added-2 removed
67 unmodified lines
68 :maxdepth: 26970 user/intro71 user/install72 user/faq73.. user/quickstart72 user/quickstart73 user/advanced747576Community Guide77-----------------7879This part of the documentation, which is mostly prose, details the80Requests ecosystem and community.8182.. toctree::83 :maxdepth: 28485 community/faq86 community/support87 community/updates8889API Documentation90-----------------9192If you are looking for information on a specific function, class or method,
15 unmodified lines
108 :maxdepth: 2109110 dev/internals111 dev/todo112 dev/authors