Skip to content
Myr

integrate codes into models.py

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 d9a349c · Browse files · 1 file+6 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

1 file+6 added−4 removed

  • other:+6 added−4 removed

1 file+6 added−4 removed

modified:requests/models.py+6 added-4 removed
20 unmodified lines
21from .packages.poster.encode import multipart_encode22from .packages.poster.streaminghttp import register_openers, get_handlers23from .utils import dict_from_cookiejar24from .exceptions import RequestException, AuthenticationError, Timeout, URLRequired, InvalidMethod, TooManyRedirects25from .status_codes import codes262727REDIRECT_STATI = (301, 302, 303, 307)28REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)29303132class Request(object):33 """The :class:`Request <models.Request>` object. It carries out all functionality of34 Requests. Recommended interface is with the Requests functions.35 """
167 unmodified lines
203204 while (205 ('location' in r.headers) and206 ((self.method in ('GET', 'HEAD')) or205 (r.status_code is 303) or207 (r.status_code is codes.see_other) or208 (self.allow_redirects))209 ):210211 r.close()212211 if not len(history) < 30:213 if not len(history) < settings.max_redirects:214 raise TooManyRedirects()215216 history.append(r)217
9 unmodified lines
227 if not urlparse(url).netloc:228 url = urljoin(r.url, urllib.quote(urllib.unquote(url)))229230 # http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4229 if r.status_code is 303:231 if r.status_code is codes.see_other:232 method = 'GET'233 else:234 method = self.method235
388 unmodified lines