From d81dfe266e630c3e7341cc2a1994303e243353e1 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Wed, 30 May 2012 17:34:24 +0200 Subject: [PATCH] Added information about HTTP proxy authentication to docs --- AUTHORS.rst | 1 + docs/user/advanced.rst | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 0ab42cef..5d5d8c07 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -102,3 +102,4 @@ Patches and Suggestions - Roman Haritonov <@reclosedev> - Josh Imhoff - Arup Malakar +- Danilo Bargen (gwrtheyrn) diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst index 677ef05a..fe5e19ea 100644 --- a/docs/user/advanced.rst +++ b/docs/user/advanced.rst @@ -45,6 +45,7 @@ Any dictionaries that you pass to a request method will be merged with the sessi All values that are contained within a session are directly available to you. See the :ref:`Session API Docs ` to learn more. + SSL Cert Verification --------------------- @@ -293,6 +294,7 @@ To do so, just configure Requests with a stream to write to:: 2011-08-17T03:04:23.380175 GET http://httpbin.org/headers + Proxies ------- @@ -304,8 +306,8 @@ If you need to use a proxy, you can configure individual requests with the import requests proxies = { - "http": "10.10.1.10:3128" - "https": "10.10.1.10:1080" + "http": "10.10.1.10:3128", + "https": "10.10.1.10:1080", } requests.get("http://example.org", proxies=proxies) @@ -320,6 +322,15 @@ You can also configure proxies by environment variables ``HTTP_PROXY`` and ``HTT >>> import requests >>> requests.get("http://example.org") +To use HTTP Basic Auth with your proxy, use the `http://user:password@host/` syntax: + +:: + + proxies = { + "http": "http://user:pass@10.10.1.10:3128/", + } + + HTTP Verbs ----------