summaryrefslogtreecommitdiff
path: root/requests
diff options
context:
space:
mode:
authorKenneth Reitz <me@kennethreitz.org>2017-05-26 21:17:13 -0400
committerKenneth Reitz <me@kennethreitz.org>2017-05-26 21:17:13 -0400
commitdfd667df96f9d8102100fdf85292e6dbf4b4e22e (patch)
tree1d671f7472a57d7dbf85d22a176f9b95fcb671fe /requests
parentf41560c5d46e8cbb8d8f741b2f7d2da29a9d6b94 (diff)
downloadpython-requests-dfd667df96f9d8102100fdf85292e6dbf4b4e22e.tar.gz
who wrote this shit
Diffstat (limited to 'requests')
-rw-r--r--requests/models.py6
-rwxr-xr-xrequests/sessions.py3
2 files changed, 5 insertions, 4 deletions
diff --git a/requests/models.py b/requests/models.py
index 740143b8..6018d27c 100644
--- a/requests/models.py
+++ b/requests/models.py
@@ -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):
diff --git a/requests/sessions.py b/requests/sessions.py
index 2b0b7e1a..0cde98ef 100755
--- a/requests/sessions.py
+++ b/requests/sessions.py
@@ -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
"""