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
Provenance
- Commit
9fcfec1- Tree
8fef4fe- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent
a83268b
6 files changed+28 added−6 removed
modified:docs/community/faq.rst+6 added
79 unmodified lines80 --------------81 82 You bet!83 84+85+SSL Verification?86+-----------------87+88+Absolutely.89+modified:docs/user/advanced.rst+17 added-2 removed
43 unmodified lines44 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.45 46 All values that are contained within a session are directly available to you. See the :ref:`Session API Docs <sessionapi>` to learn more.47 48+SSL Cert Verification49+---------------------50 51+Requests 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::52+53+ >>> requests.get('https://kennethreitz.com', verify=True)54+ requests.exceptions.SSLError: hostname 'kennethreitz.com' doesn't match either of '*.herokuapp.com', 'herokuapp.com'55+56+I don't have SSL setup on this domain, so it fails. Excellent. I do hate it setup for httpbin.org though::57+58+ >>> requests.get('https://httpbin.org', verify=True)59+ <Response [200]>60+61+You can also pass ``verify`` the path to a CA_BUNDLE file for private certs. You can also set the ``REQUESTS_CA_BUNDLE`` environment variable.62+63+64 Body Content Workflow50-----------------------65+---------------------66 67 By 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.68 69 Let's walk through it::190 unmodified lines260 261 Streaming Requests262 ------------------263 249-With ``requests.Response.iter_lines()`` you can easily iterate over streaming 264+With ``requests.Response.iter_lines()`` you can easily iterate over streaming265 APIs such as the `Twitter Streaming API <https://dev.twitter.com/docs/streaming-api>`_.266 267 To use the Twitter Streaming API to track the keyword "requests":268 25 unmodified linesmodified:docs/index.rst+1 added-2 removed
63 unmodified lines64 65 - 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 Dependencies75 76 77-77 User Guide78 ----------79 80 This part of the documentation, which is mostly prose, begins with some50 unmodified linesmodified:requests/api.py+1 added
29 unmodified lines30 :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 """36 37 s = kwargs.get('session') or sessions.session()38 return s.request(method=method, url=url, **kwargs)77 unmodified linesmodified:requests/sessions.py+1 added-1 removed
131 unmodified lines132 :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 """138 139 method = str(method).upper()140 148 unmodified linesmodified:README.rst+2 added-1 removed
32 unmodified lines33 34 Features35 --------36 37+- 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