Skip to content
Myr

models cleanup

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 58e3dd9 · Browse files · 1 file+9 added−3 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+9 added−3 removed

  • other:+9 added−3 removed

1 file+9 added−3 removed

modified:requests/models.py+9 added-3 removed
21 unmodified lines
22from .packages.urllib3.exceptions import MaxRetryError23from .packages.urllib3.exceptions import SSLError as _SSLError24from .packages.urllib3.exceptions import HTTPError as _HTTPError25from .packages.urllib3 import connectionpool, poolmanager26from .packages.urllib3.filepost import encode_multipart_formdata27from .exceptions import (28 Timeout, URLRequired, TooManyRedirects, HTTPError, ConnectionError)29from .utils import (30 dict_from_cookiejar, get_unicode_from_response,31 stream_decode_response_unicode, decode_gzip, stream_decode_gzip)3233343536REDIRECT_STATI = (codes.moved, codes.found, codes.other, codes.temporary_moved)373839
292 unmodified lines
332 # Nottin' on you.333 body = None334 content_type = None335333 from .packages.urllib3.filepost import encode_multipart_formdata334336 # Multi-part file uploads.337 if self.files:338 if not isinstance(self.data, basestring):339
9 unmodified lines
349 pass350 # TODO: Conflict?351 else:352 if self.data:353354 body = self._enc_data355 if isinstance(self.data, basestring):356 content_type = None357 else:353 content_type = 'application/x-www-form-urlencoded'358 content_type = 'application/x-www-form-urlencoded'359360 # Add content-type if it wasn't explicitly provided.361 if (content_type) and (not 'content-type' in self.headers):362 self.headers['Content-Type'] = content_type
39 unmodified lines
402 self.headers['Cookie'] = cookie_header403404 try:405 # Send the request.406407 r = conn.urlopen(408 method=self.method,409 url=url,410 body=body,
180 unmodified lines