summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJason Grout <jgrout6@bloomberg.net>2015-08-25 15:11:27 +0000
committerJason Grout <jgrout6@bloomberg.net>2015-08-25 15:11:27 +0000
commit618514231bd24d7eec7b8d486f4a55cb7ef8d522 (patch)
tree2a889f4bf0407dc59b822d3ba87371f3955ff5c2 /docs
parent56844d128754b923211a981618903c34fd36ed7b (diff)
downloadpython-requests-618514231bd24d7eec7b8d486f4a55cb7ef8d522.tar.gz
Reword documentation for per-host proxies
Diffstat (limited to 'docs')
-rw-r--r--docs/user/advanced.rst15
1 files changed, 8 insertions, 7 deletions
diff --git a/docs/user/advanced.rst b/docs/user/advanced.rst
index 78fc6054..c0e6aabc 100644
--- a/docs/user/advanced.rst
+++ b/docs/user/advanced.rst
@@ -459,18 +459,12 @@ If you need to use a proxy, you can configure individual requests with the
import requests
proxies = {
- "http://10.20.1.128": "http://10.10.1.10:5323",
- "https://10.20.1.140": "http://10.10.1.10:6431"
"http": "http://10.10.1.10:3128",
"https": "http://10.10.1.10:1080",
}
requests.get("http://example.org", proxies=proxies)
-A request's ``<scheme>://<hostname>`` is looked up in the proxies
-dictionary first, to provide host-specific proxies. If no
-host-specific proxy is found, the request's scheme is looked up.
-
You can also configure proxies by setting the environment variables
``HTTP_PROXY`` and ``HTTPS_PROXY``.
@@ -488,8 +482,15 @@ To use HTTP Basic Auth with your proxy, use the `http://user:password@host/` syn
"http": "http://user:pass@10.10.1.10:3128/",
}
-Note that proxy URLs must include the scheme.
+To give a proxy for a specific scheme and host, use the
+`scheme://host` form for the key::
+
+ proxies = {
+ "http://10.20.1.128": "http://10.10.1.10:5323",
+ }
+Note that proxy URLs must include the scheme.
+
.. _compliance:
Compliance