This document covers some of Requests more advanced features.
+.. _session-objects:
Session Objects
---------------
All values that are contained within a session are directly available to you.
See the :ref:`Session API Docs <sessionapi>` to learn more.
+.. _request-and-response-objects:
+
Request and Response Objects
----------------------------
{'Accept-Encoding': 'identity, deflate, compress, gzip',
'Accept': '*/*', 'User-Agent': 'python-requests/1.2.0'}
+.. _prepared-requests:
+
Prepared Requests
-----------------
>>> requests.get('https://kennethreitz.com', cert='/wrong_path/server.pem')
SSLError: [Errno 336265225] _ssl.c:347: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib
+.. _body-content-workflow:
Body Content Workflow
---------------------
.. _`documented here`: http://docs.python.org/2/library/contextlib.html#contextlib.closing
+.. _keep-alive:
Keep-Alive
----------
data has been read; be sure to either set ``stream`` to ``False`` or read the
``content`` property of the ``Response`` object.
+.. _streaming-uploads:
Streaming Uploads
-----------------
with open('massive-body', 'rb') as f:
requests.post('http://some.url/streamed', data=f)
+.. _chunk-encoding:
Chunk-Encoded Requests
----------------------
requests.post('http://some.url/chunked', data=gen())
+.. _multipart:
POST Multiple Multipart-Encoded Files
-------------------------------------
...
}
+.. _event-hooks:
Event Hooks
-----------
http://httpbin.org
<Response [200]>
+.. _custom-auth:
Custom Authentication
---------------------
if line:
print(json.loads(line))
+.. _proxies:
Proxies
-------