Skip to content
Myr

default headers and content encoding settings

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Closes #78

authored by Kenneth Reitz · committed by Kenneth Reitz · parent 87560d6 · Browse files · 2 files+17 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+17 added−4 removed

  • other:+17 added−4 removed

2 files+17 added−4 removed

modified:requests/config.py+2 added-1 removed
52 unmodified lines
53 return None54 return object.__getattribute__(self, key)5556settings = Settings()57settings.base_headers = {'User-Agent': 'python-requests.org'}57settings.base_headers = {'User-Agent': 'python-requests.org'}58settings.accept_gzip = True
modified:requests/models.py+15 added-3 removed
78 unmodified lines
79 self.cookiejar = cookiejar80 #: True if Request has been sent.81 self.sent = False8283 headers = settings.base_headers84 if self.headers:85 headers.update(self.headers)8384 # Header manipulation and defaults.8586 if settings.accept_gzip:87 settings.base_headers.update({'Accept-Encoding': 'gzip'})8889 if headers:90 headers = CaseInsensitiveDict(self.headers)91 else:92 headers = CaseInsensitiveDict()9394 for (k, v) in settings.base_headers.items():95 if k not in headers:96 headers[k] = v9798 self.headers = headers99100101 def __repr__(self):
465 unmodified lines