Migrate new docs over.
authorKenneth Reitz <me@kennethreitz.com>
Thu, 13 Oct 2011 18:54:36 +0000 (14:54 -0400)
committerKenneth Reitz <me@kennethreitz.com>
Thu, 13 Oct 2011 18:54:36 +0000 (14:54 -0400)
docs/api.rst
docs/community/faq.rst
docs/community/updates.rst
docs/index.rst
docs/user/advanced.rst
docs/user/install.rst
docs/user/intro.rst
docs/user/quickstart.rst

index cbd24fdb705eea3b1db8853362234ea201936dc9..328e9e8bf8ec699e1aca8dab2dc6618fcff74388 100644 (file)
@@ -13,34 +13,52 @@ important right here and provide links to the canonical documentation.
 Main Interface
 --------------
 
-All of Request's functionality can be accessed by these 6 methods. They
-all return a :class:`Response <models.Response>` object.
+All of Request's functionality can be accessed by these 7 methods.
+They all return an instance of the :class:`Response <Response>` object.
 
+.. autofunction:: request
 .. autofunction:: head
 .. autofunction:: get
 .. autofunction:: post
 .. autofunction:: put
 .. autofunction:: patch
 .. autofunction:: delete
-.. autofunction:: request
+
 
 -----------
 
 
-.. autoclass:: requests.models.Response
+.. autoclass:: Response
    :inherited-members:
 
 
-Exceptions
-----------
 
-.. autoexception:: HTTPError
+Utilities
+---------
 
-.. autoexception:: RequestException
+These functions are used internally, but may be useful outside of
+Requests.
+
+.. module:: requests.utils
+
+Cookies
+~~~~~~~
+
+.. autofunction:: dict_from_cookiejar
+.. autofunction:: cookiejar_from_dict
+.. autofunction:: add_dict_to_cookiejar
+
+Curl
+~~~~
+.. autofunction:: curl_from_request
+
+Encodings
+~~~~~~~~~
 
-.. autoexception:: requests.models.AuthenticationError
-.. autoexception:: requests.models.URLRequired
-.. autoexception:: requests.models.InvalidMethod
+.. autofunction:: get_encodings_from_content
+.. autofunction:: get_encoding_from_headers
+.. autofunction:: get_unicode_from_response
+.. autofunction:: decode_gzip
 
 
 Internals
@@ -50,8 +68,26 @@ These items are an internal component to Requests, and should never be
 seen by the end user (developer). This part of the API documentation
 exists for those who are extending the functionality of Requests.
 
+Exceptions
+~~~~~~~~~~
+
+.. module:: requests
+
+.. autoexception:: HTTPError
+
+.. autoexception:: RequestException
+
+.. autoexception:: AuthenticationError
+.. autoexception:: URLRequired
+.. autoexception:: InvalidMethod
+.. autoexception:: TooManyRedirects
+
+
+
 Classes
 ~~~~~~~
 
-.. autoclass:: requests.models.Request
+.. autoclass:: requests.Request
    :inherited-members:
+
+
index b5717648d830df1b3e5865c95b1ff6d3dd7aa57c..91ca06b245234770e647edc5f9914b945c8471e0 100644 (file)
@@ -3,7 +3,24 @@
 Frequently Asked Questions
 ==========================
 
-This part of the documentation covers common questions about Requests.
+This part of the documentation answers common questions about Requests.
+
+Encoded Data?
+-------------
+
+Requests automatically decompresses gzip-encoded responses, and does
+its best to decodes response content to unicode when possible.
+
+You can get direct access to the raw response (and even the socket),
+if needed as well.
+
+
+Custom User-Agents?
+-------------------
+
+Requests allows you to easily override User-Agent strings, along with
+any other HTTP Header.
+
 
 Why not Httplib2?
 -----------------
@@ -34,10 +51,33 @@ Chris Adams gave an excellent summary on
 Python 3 Support?
 -----------------
 
-It's on the way. Here's a list of `supported interpreters <interpreters>`_.
+It's on the way. Here's a list of Python platforms that are officially
+supported:
+
+* cPython 2.5
+* cPython 2.5.5
+* cPython 2.5.6
+* cPython 2.6
+* cPython 2.6.6
+* cPython 2.6.7
+* cPython 2.7
+* cPython 2.7.1
+* cPython 2.7.2
+* PyPy-c 1.4
+* PyPy-c 1.5
+
+
+Support for Python 3.x is coming *very* soon.
 
 
 Keep-alive Support?
 -------------------
 
-It's on the way.
\ No newline at end of file
+It's on the way.
+
+
+Proxy Support?
+--------------
+
+You bet!
+
index 942ccac197d846462d13025af65683e07f422ea5..e6e1559fed5ff487f6160ced0d27ff449f132026 100644 (file)
@@ -20,7 +20,6 @@ I often tweet about new features and releases of Requests.
 Follow `@kennethreitz <https://twitter.com/kennethreitz>`_ for updates.
 
 
-
 Mailing List
 ------------
 
index 8bef62bb3a1bfe2e0b9a4791a1ffd346f7209b50..d849ed5fb9c8736fa33a3e36f3f8d971c2368fc8 100644 (file)
@@ -36,10 +36,18 @@ multipart files, and parameters with simple Python dictionaries, and access the
 response data in the same way. It's powered by :py:class:`urllib2`, but it does
 all the hard work and crazy hacks for you.
 
-Testimonals
------------
+Testimonials
+------------
 
-`Twitter, Inc <http://twitter.com>`_ uses Requests internally.
+`Twitter, Inc <http://twitter.com>`_,
+a U.S. Federal Institution,
+`Readability <http://readability.com>`_, and
+`Work for Pie <http://workforpie.com>`_
+use Requests internally.
+
+**Armin Ronacher**
+    Requests is the perfect example how beautiful an API can be with the
+    right level of abstraction.
 
 **Daniel Greenfeld**
     Nuked a 1200 LOC spaghetti code library with 10 lines of code thanks to
@@ -52,10 +60,6 @@ Testimonals
 **Rich Leland**
    Requests is awesome. That is all.
 
-**Steve Pike**
-  I can never remember how to do it the regular way.
-  ``import requests; requests.get()`` is just so easy!
-
 
 User Guide
 ----------
index d145da21ef502f718dbc4c58a36d7686ae8a573c..ae7827c93e209735c08bd88bdd48e75c0b80d620 100644 (file)
@@ -66,7 +66,7 @@ Available hooks:
 
 You can assign a hook function on a per-request basis by passing a
 ``{hook_name: callback_function}`` dictionary to the ``hooks`` request
-paramaeter::
+parameter::
 
     hooks=dict(args=print_url)
 
@@ -134,4 +134,4 @@ To do so, just configure Requests with a stream to write to::
     >>> requests.settings.verbose = sys.stderr
     >>> requests.get('http://httpbin.org/headers')
     2011-08-17T03:04:23.380175   GET   http://httpbin.org/headers
-    <Response [200]>
\ No newline at end of file
+    <Response [200]>
index cdc6d86ceab6137025e9a7132d4bfac8555c034a..dc4aa627cdf1dd69e0d344ccd76a73ee0dc57108 100644 (file)
@@ -3,7 +3,8 @@
 Installation
 ============
 
-This part of the documentation covers the installation of Requests. The first step to using any software package is getting it properly installed.
+This part of the documentation covers the installation of Requests.
+The first step to using any software package is getting it properly installed.
 
 
 Distribute & Pip
@@ -24,7 +25,8 @@ But, you really `shouldn't do that <http://www.pip-installer.org/en/latest/index
 Cheeseshop Mirror
 -----------------
 
-If the Cheeseshop is down, you can also install Requests from Kenneth Reitz's personal `Cheeseshop mirror <http://pip.kreitz.co/>`_::
+If the Cheeseshop is down, you can also install Requests from Kenneth Reitz's
+personal `Cheeseshop mirror <http://pip.kreitz.co/>`_::
 
     $ pip install -i http://pip.kreitz.co/simple requests
 
@@ -48,6 +50,7 @@ Or, download the `zipball <https://github.com/kennethreitz/requests/zipball/mast
     $ curl -O https://github.com/kennethreitz/requests/zipball/master
 
 
-Once you have a copy of the source, you can embed it in your Python package, or install it into your site-packages easily::
+Once you have a copy of the source, you can embed it in your Python package,
+or install it into your site-packages easily::
 
     $ python setup.py install
index 217cb81c8a08007238d955aeedf12e167cdf544d..c2b6bf3669439c7b9d14b7fb896e98c921cecb57 100644 (file)
@@ -21,10 +21,16 @@ All contributions to Requests should keep these important rules in mind.
 ISC License
 -----------
 
+A large number of open source projects you find today are `GPL Licensed`_.
+While the GPL has its time and place, it should most certainly not be your
+go-to license for your next open source project.
 
-A large number of open source projects you find today are `GPL Licensed`_. While the GPL has its time and place, it should most certainly not be your go-to license for your next open source project.
+A project that is released as GPL cannot be used in any commercial product
+without the product itself also being offered as open source.
 
-A project that is released as GPL cannot be used in any commercial product without the product itself also being offered as open source. The MIT, BSD, ISC, and Apache2 licenses are great alternatives to the GPL that allow your open-source software to be used freely in proprietary, closed-source software.
+The MIT, BSD, ISC, and Apache2 licenses are great alternatives to the GPL
+that allow your open-source software to be used freely in proprietary,
+closed-source software.
 
 Requests is released under terms of `The ISC License`_.
 
@@ -42,23 +48,4 @@ Requests License
     THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 
-.. _interpreters:
-Python Interpreters
--------------------
 
-At this time, the following Python platforms are officially supported:
-
-* cPython 2.5
-* cPython 2.5.5
-* cPython 2.5.6
-* cPython 2.6
-* cPython 2.6.6
-* cPython 2.6.7
-* cPython 2.7
-* cPython 2.7.1
-* cPython 2.7.2
-* PyPy-c 1.4
-* PyPy-c 1.5
-
-
-Support for Python 3.x is planned.
\ No newline at end of file
index f9370f5910a22d8d5a679e6f0baea4006fb22342..7ec7593d2ca47e8352342e7e0ce59781344d50e6 100644 (file)
@@ -5,7 +5,9 @@ Quickstart
 
 .. module:: requests.models
 
-Eager to get started? This page gives a good introduction in how to get started with Requests. This assumes you already have Requests installed. If you do not, head over to the :ref:`Installation <install>` section.
+Eager to get started? This page gives a good introduction in how to get started
+with Requests. This assumes you already have Requests installed. If you do not,
+head over to the :ref:`Installation <install>` section.
 
 First, make sure that:
 
@@ -25,7 +27,8 @@ Let's get GitHub's public timeline ::
 
     r = requests.get('https://github.com/timeline.json')
 
-Now, we have a :class:`Response` object called ``r``. We can get all the information we need from this.
+Now, we have a :class:`Response` object called ``r``. We can get all the
+information we need from this.
 
 
 Response Content
@@ -90,7 +93,8 @@ interface::
         'content-type': 'application/json; charset=utf-8'
     }
 
-The dictionary is special, though: it's made just for HTTP headers. According to `RFC 2616 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html>`_, HTTP
+The dictionary is special, though: it's made just for HTTP headers. According to
+`RFC 2616 <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html>`_, HTTP
 Headers are case-insensitive.
 
 So, we can access the headers using any capitalization we want::
@@ -118,7 +122,7 @@ If a response contains some Cookies, you can get quick access to them::
     >>> print r.cookies
     {'requests-is': 'awesome'}
 
-The underlying CookieJar is also available for more advanced handing::
+The underlying CookieJar is also available for more advanced handling::
 
     >>> r.request.cookiejar
     <cookielib.CookieJar>