Skip to content
Myr

ssl docs

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 a83268b · Browse files · 6 files+28 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

6 files+28 added−6 removed

  • other:+28 added−6 removed

6 files+28 added−6 removed

modified:docs/community/faq.rst+6 added
79 unmodified lines
80--------------8182You bet!838485SSL Verification?86-----------------8788Absolutely.89
modified:docs/user/advanced.rst+17 added-2 removed
43 unmodified lines
44 Sometimes you'll want to omit session-level keys from a dict parameter. To do this, you simply set that key's value to ``None`` in the method-level parameter. It will automatically be omitted.4546All values that are contained within a session are directly available to you. See the :ref:`Session API Docs <sessionapi>` to learn more.4748SSL Cert Verification49---------------------5051Requests can verify SSL certificates for HTTPS requests, just like a web browser. To check a host's SSL certificate, you can use the ``verify`` argument::5253 >>> requests.get('https://kennethreitz.com', verify=True)54 requests.exceptions.SSLError: hostname 'kennethreitz.com' doesn't match either of '*.herokuapp.com', 'herokuapp.com'5556I don't have SSL setup on this domain, so it fails. Excellent. I do hate it setup for httpbin.org though::5758 >>> requests.get('https://httpbin.org', verify=True)59 <Response [200]>6061You can also pass ``verify`` the path to a CA_BUNDLE file for private certs. You can also set the ``REQUESTS_CA_BUNDLE`` environment variable.626364Body Content Workflow50----------------------65---------------------6667By default, when you make a request, the body of the response isn't downloaded immediately. The response headers are downloaded when you make a request, but the content isn't downloaded until you access the :class:`Response.content` attribute.6869Let's walk through it::
190 unmodified lines
260261Streaming Requests262------------------263249With ``requests.Response.iter_lines()`` you can easily iterate over streaming 264With ``requests.Response.iter_lines()`` you can easily iterate over streaming265APIs such as the `Twitter Streaming API <https://dev.twitter.com/docs/streaming-api>`_.266267To use the Twitter Streaming API to track the keyword "requests":268
25 unmodified lines
modified:docs/index.rst+1 added-2 removed
63 unmodified lines
6465- International Domains and URLs66- Keep-Alive & Connection Pooling67- Sessions with Cookie Persistence68- Browser-style SSL Verification69- Basic/Digest Authentication70- Elegant Key/Value Cookies71- Automatic Decompression72- Unicode Response Bodies73- Multipart File Uploads74- Connection Timeouts74- Zero Dependencies75767777User Guide78----------7980This part of the documentation, which is mostly prose, begins with some
50 unmodified lines
modified:requests/api.py+1 added
29 unmodified lines
30 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.31 :param return_response: (optional) If False, an un-sent Request object will returned.32 :param session: (optional) A :class:`Session` object to be used for the request.33 :param config: (optional) A configuration dictionary.34 :param verify: (optional) if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided.35 """3637 s = kwargs.get('session') or sessions.session()38 return s.request(method=method, url=url, **kwargs)
77 unmodified lines
modified:requests/sessions.py+1 added-1 removed
131 unmodified lines
132 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.133 :param return_response: (optional) If False, an un-sent Request object will returned.134 :param config: (optional) A configuration dictionary.135 :param prefetch: (optional) if ``True``, the response content will be immediately downloaded.136 :param prefetch: (optional) if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided.136 :param verify: (optional) if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided.137 """138139 method = str(method).upper()140
148 unmodified lines
modified:README.rst+2 added-1 removed
32 unmodified lines
3334Features35--------3637- Browser standard SSL verification.38- Extremely simple HEAD, GET, POST, PUT, PATCH, DELETE Requests.39- Gevent support for Asyncronous Requests.39- Sessions with cookie persistience.40- Sessions with cookie persistence.41- Basic, Digest, and Custom Authentication support.42- Automatic form-encoding of dictionaries43- A simple dictionary interface for request/response cookies.44- Multipart file uploads.
59 unmodified lines