Apply requests environment settings

Allows use of enironment variables for setting proxies and trusted CAs.

See:
http://docs.python-requests.org/en/master/user/advanced/#prepared-requests
pull/83/head
Ivan Habunek 2018-12-30 10:38:40 +01:00
rodzic 9d10ce22f1
commit 226713a5a0
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -8,7 +8,8 @@ def send_request(request, allow_redirects=True):
with Session() as session:
prepared = session.prepare_request(request)
response = session.send(prepared, allow_redirects=allow_redirects)
settings = session.merge_environment_settings(prepared.url, {}, None, None, None)
response = session.send(prepared, allow_redirects=allow_redirects, **settings)
log_response(response)