mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Added Cookies documentation.
This commit is contained in:
+8
-7
@@ -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
@@ -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.
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user