Skip to content
Myr

added response.url support for 301's and the like.

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent ca51bdb · Browse files · 2 files+8 added−1 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+8 added−1 removed

  • other:+8 added−1 removed

2 files+8 added−1 removed

modified:requests/core.py+5 added-1 removed
135 unmodified lines
136 try:137 resp = opener(req)138 self.response.status_code = resp.code139 self.response.headers = resp.info().dict140 if self.method.lower() == 'get':140 if self.method == 'GET':141 self.response.content = resp.read()142 self.response.url = resp.url143144 success = True145 except urllib2.HTTPError as why:146 self.response.status_code = why.code
25 unmodified lines
172173 self.response.status_code = resp.code174 self.response.headers = resp.info().dict175 self.response.content = resp.read()176 self.response.url = resp.url177178 success = True179180 except urllib2.HTTPError as why:
28 unmodified lines
209210 self.response.status_code = resp.code211 self.response.headers = resp.info().dict212 self.response.content = resp.read()213 self.response.url = resp.url214215 success = True216217 except urllib2.HTTPError as why:
14 unmodified lines
232 def __init__(self):233 self.content = None234 self.status_code = None235 self.headers = dict()236 self.url = None237 238 def __repr__(self):239 return '<Response [%s]>' % (self.status_code)240
186 unmodified lines
modified:README.rst+3 added
86 unmodified lines
8788 Request.content:89 (Bytes) Received Content9091 Request.url92 (String) URL of response. Useful for detecting redirects. 939495**HTTP Authentication Registry:**9697 You can register AuthObjects to automatically enable HTTP Authentication on requests that contain a registered base URL string.98
34 unmodified lines