Added Cookies documentation.

This commit is contained in:
Kenneth Reitz
2011-02-14 12:52:15 -05:00
parent 397bd4b676
commit 98c8a78c3e
2 changed files with 14 additions and 8 deletions
+8 -7
View File
@@ -56,27 +56,28 @@ API
**Requests:**
All request functions return a Response object (see below).
If a {filename: fileobject} dictionary is passed in (files=...), a multipart_encode upload will be performed.
If CookieJar object is is passed in (cookies=...), the cookies will be sent with the request.
GET Requests
>>> request.get(url, params={}, headers={} auth=None)
>>> request.get(url, params={}, headers={}, cookies=None, auth=None)
<request object>
HEAD Requests
>>> request.head(url, params={}, headers={} auth=None)
>>> request.head(url, params={}, headers={}, cookies=None, auth=None)
<request object>
PUT Requests
>>> request.put(url, data='', headers={}, files={}, auth=None)
>>> request.put(url, data='', headers={}, files={}, cookies=None, auth=None)
<request object>
# If files dictionary ( {filename: fileobject, ...} ) is given, a multi-part upload is performed.
POST Requests
>>> request.post(url, data={}, headers={}, files={}, auth=None)
>>> request.post(url, data={}, headers={}, files={}, cookies=None, auth=None)
<request object>
# If files dictionary ( {filename: fileobject, ...} ) is given, a multi-part upload is performed.
DELETE Requests
>>> request.delete(url, params={}, headers={}, auth=None)
>>> request.delete(url, params={}, headers={}, cookies=None, auth=None)
<request object>
+6 -1
View File
@@ -288,7 +288,8 @@ def get(url, params={}, headers={}, cookies=None, auth=None):
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary of GET Parameters to send with the :class:`Request`.
:param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`.
:param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.
:param cookies: (optional) CookieJar object to send with the :class:`Request`.
:param auth: (optional) AuthObject to enable Basic HTTP Auth.
"""
@@ -312,6 +313,7 @@ def head(url, params={}, headers={}, cookies=None, auth=None):
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary of GET Parameters to send with the :class:`Request`.
:param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`.
:param cookies: (optional) CookieJar object to send with the :class:`Request`.
:param auth: (optional) AuthObject to enable Basic HTTP Auth.
"""
@@ -337,6 +339,7 @@ def post(url, data={}, headers={}, files=None, cookies=None, auth=None):
:param data: (optional) Dictionary of POST Data to send with the :class:`Request`.
:param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`.
:param files: (optional) Dictionary of 'filename': file-like-objects for multipart encoding upload.
:param cookies: (optional) CookieJar object to send with the :class:`Request`.
:param auth: (optional) AuthObject to enable Basic HTTP Auth.
"""
@@ -365,6 +368,7 @@ def put(url, data='', headers={}, files={}, cookies=None, auth=None):
:param data: (optional) Bytes of PUT Data to send with the :class:`Request`.
:param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`.
:param files: (optional) Dictionary of 'filename': file-like-objects for multipart encoding upload.
:param cookies: (optional) CookieJar object to send with the :class:`Request`.
:param auth: (optional) AuthObject to enable Basic HTTP Auth.
"""
@@ -389,6 +393,7 @@ def delete(url, params={}, headers={}, cookies=None, auth=None):
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary of GET Parameters to send with the :class:`Request`.
:param headers: (optional) Dictionary of HTTP Headers to sent with the :class:`Request`.
:param cookies: (optional) CookieJar object to send with the :class:`Request`.
:param auth: (optional) AuthObject to enable Basic HTTP Auth.
"""