who wrote this shit

This commit is contained in:
2017-05-26 21:17:13 -04:00
parent f41560c5d4
commit dfd667df96
2 changed files with 5 additions and 4 deletions
+4 -2
View File
@@ -711,15 +711,17 @@ class Response(object):
@property
def is_permanent_redirect(self):
"""True if this Response one of the permanent versions of redirect"""
"""True if this Response one of the permanent versions of redirect."""
return ('location' in self.headers and self.status_code in (codes.moved_permanently, codes.permanent_redirect))
def next(self):
"""Returns a PreparedRequest for the next request in a redirect chain, if there is one."""
if self.is_redirect:
return self._next
@property
def apparent_encoding(self):
"""The apparent encoding, provided by the chardet library"""
"""The apparent encoding, provided by the chardet library."""
return chardet.detect(self.content)['encoding']
def iter_content(self, chunk_size=1, decode_unicode=False):
+1 -2
View File
@@ -601,8 +601,7 @@ class Session(SessionRedirectMixin):
return self.request('DELETE', url, **kwargs)
def send(self, request, **kwargs):
"""
Send a given PreparedRequest.
"""Send a given PreparedRequest.
:rtype: requests.Response
"""