If the message is being sent through a proxy, the full URL has to be
used. Otherwise, we should only use the path portion of the URL.
- This shoudl not be called from user code, and is only exposed for use
+ This should not be called from user code, and is only exposed for use
when subclassing the
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
import requests
from requests.auth import HTTPDigestAuth
from requests.adapters import HTTPAdapter
-from requests.compat import str, cookielib
+from requests.compat import str, cookielib, getproxies
from requests.cookies import cookiejar_from_dict
from requests.exceptions import InvalidURL, MissingSchema
from requests.structures import CaseInsensitiveDict
"http://example.com/path?key=value&a=b#fragment")
def test_mixed_case_scheme_acceptable(self):
+ proxies = getproxies()
s = requests.Session()
+ s.proxies = proxies
r = requests.Request('GET', 'http://httpbin.org/get')
r = s.send(r.prepare())
self.assertEqual(r.status_code,200)
s = requests.Session()
+ s.proxies = proxies
r = requests.Request('GET', 'HTTP://httpbin.org/get')
r = s.send(r.prepare())
self.assertEqual(r.status_code,200)
def test_HTTP_200_OK_GET_ALTERNATIVE(self):
r = requests.Request('GET', httpbin('get'))
s = requests.Session()
+ s.proxies = getproxies()
r = s.send(r.prepare())
prep = req.prepare()
s = requests.Session()
+ s.proxies = getproxies()
resp = s.send(prep)
self.assertTrue(hasattr(resp, 'hook_working'))
s = requests.Session()
s = pickle.loads(pickle.dumps(s))
+ s.proxies = getproxies()
r = s.send(r.prepare())
self.assertEqual(r.status_code, 200)