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
Provenance
- Commit
d50742f- Tree
e4ea32e- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent
3bc9a18
7 files changed+159 added−103 removed
added:docs/community/faq.rst+43 added
1+.. _faq:2+3+Frequently Asked Questions4+==========================5+6+This part of the documentation covers common questions about Requests.7+8+Why not Httplib2?9+-----------------10+11+Chris Adams gave an excellent summary on12+`Hacker News <http://news.ycombinator.com/item?id=2884406>`_:13+14+ 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].22+23+ Disclosure: I'm listed in the requests AUTHORS file but can claim credit24+ for, oh, about 0.0001% of the awesomeness.25+26+ 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.32+33+34+Python 3 Support?35+-----------------36+37+It's on the way.38+39+40+Keep-alive Support?41+-------------------42+43+It's on the way.added:docs/community/support.rst+37 added
1+.. _support:2+3+Support4+=======5+6+If you have a questions or issues about Requests, there are serveral options:7+8+Send a Tweet9+------------10+11+If your question is less than 140 characters, feel free to send a tweet to12+`@kennethreitz <http://twitter.com/kennethreitz>`_.13+14+15+File an Issue16+-------------17+18+If you notice some unexpected behavior in Requests, or want to see support19+for a new feature,20+`file an issue on GitHub <https://github.com/kennethreitz/requests/issues>`_.21+22+23+E-mail24+------25+26+I'm more than happy to answer any personal or in-depth questions about27+Requests. Feel free to email28+`requests@kennethreitz.com <mailto:requests@kennethreitz.com>`_.29+30+31+IRC32+---33+34+The official Freenode channel for Requests is35+`#python-requests <irc://irc.freenode.net/python-requests>`_36+37+I'm also available as **kennethreitz** on Freenode.added:docs/community/updates.rst+31 added
1+.. _updates:2+3+Updates4+=======5+6+If you'd like to stay up to date on the community and development of Requests,7+there are serveral options:8+9+GitHub10+------11+12+The best way to track the development of Requests is through13+`the GitHub repo <https://github.com/kennethreitz/requests>`_.14+15+Twitter16+-------17+18+I often tweet about new features and releases of Requests.19+20+Follow `@kennethreitz <https://twitter.com/kennethreitz>`_ for updates.21+22+23+24+Mailing List25+------------26+27+There's a low-volume mailing list for Requests. To subscribe to the28+mailing list, send an email to29+`requests@librelist.org <mailto:requests@librelist.org>`_.30+31+added:docs/dev/authors.rst+5 added
1+Authors2+=======3+4+5+.. include:: ../../AUTHORSdeleted:docs/user/faq.rst-43 removed
1-.. _faq:2-3-Frequently Asked Questions4-==========================5-6-This part of the documentation covers common questions about Requests.7-8-Why not Httplib2?9------------------10-11-Chris Adams gave an excellent summary on12-`Hacker News <http://news.ycombinator.com/item?id=2884406>`_:13-14- 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].22-23- Disclosure: I'm listed in the requests AUTHORS file but can claim credit24- for, oh, about 0.0001% of the awesomeness.25-26- 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.32-33-34-Python 3 Support?35------------------36-37-It's on the way.38-39-40-Keep-alive Support?41--------------------42-43-It's on the way.modified:docs/user/quickstart.rst+28 added-58 removed
1-Feature Overview2-================1+.. _quickstart:2 4-Requests is designed to solve a 90% use case — making simple requests. While most5-HTTP libraries are extremely extensible, they often attempt to support the entire HTTP Spec.6-This 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.7-8-9-.. _features:10-11-Requests Can:12--------------13-14-- 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 & Gevent26-27-28-Requests Can't:29----------------30-31-- Handle Caching32-- Handle Keep-Alives33-34-3 Quickstart4 ==========5 6+.. module:: requests7 39-GET Request40------------8+Eager 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.9 10+First, make sure that:11 43-Adding Parameters44------------------12+* Tablib is :ref:`installed <install>`13+* Tablib is :ref:`up-to-date <updates>`14 15 16+Lets gets started with some simple use cases and examples.17 48-Adding Headers49---------------18 51-52-53-HTTP Basic Auth54----------------55-56-57-Tracking Redirects19+Make a GET Request20 ------------------21 22+Making a standard request with Requests is very simple.23 24+Let's get GitHub's public timeline ::25 26+ r = requests.get('https://github.com/timeline.json')27 63-HTTP POST (Form Data)64----------------------28+Now, we have a :class:`Response` object. We can get all the information29+we need from this.30 31 67-HTTP POST (Binary Data)68------------------------32+Response Content33+----------------34 35+We can read the content of the server's response::36 71-HTTP POST (Multipart Files)72----------------------------37+ >>> r.content38+ '[{"repository":{"open_issues":0,"url":"https://github.com/...39 40 75-HTTP PUT76---------41 42+Response Status Codes43+---------------------44 79-HTTP DELETE80------------45+We can check the response status code::46 47+ >>> r.status_code48+ 20049 83-HTTP HEAD84----------50+Requests also comes with a built-in status code lookup object for easy51+reference::52+53+ >>> r.status_code == requests.codes.ok54+ Truemodified:docs/index.rst+15 added-2 removed
67 unmodified lines68 :maxdepth: 269 70 user/intro71 user/install72- user/faq73-.. user/quickstart72+ user/quickstart73 user/advanced74 75 76+Community Guide77+-----------------78+79+This part of the documentation, which is mostly prose, details the80+Requests ecosystem and community.81+82+.. toctree::83+ :maxdepth: 284+85+ community/faq86+ community/support87+ community/updates88+89 API Documentation90 -----------------91 92 If you are looking for information on a specific function, class or method,15 unmodified lines108 :maxdepth: 2109 110 dev/internals111 dev/todo112+ dev/authors