|
|
@ -273,7 +273,9 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): |
|
|
|
"""The fully mutable :class:`PreparedRequest <PreparedRequest>` object, |
|
|
|
containing the exact bytes that will be sent to the server. |
|
|
|
|
|
|
|
Generated from either a :class:`Request <Request>` object or manually. |
|
|
|
Instances are generated from a :class:`Request <Request>` object, and |
|
|
|
should not be instantiated manually; doing so may produce undesirable |
|
|
|
effects. |
|
|
|
|
|
|
|
Usage:: |
|
|
|
|
|
|
@ -473,12 +475,12 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin): |
|
|
|
not isinstance(data, (basestring, list, tuple, Mapping)) |
|
|
|
]) |
|
|
|
|
|
|
|
try: |
|
|
|
length = super_len(data) |
|
|
|
except (TypeError, AttributeError, UnsupportedOperation): |
|
|
|
length = None |
|
|
|
|
|
|
|
if is_stream: |
|
|
|
try: |
|
|
|
length = super_len(data) |
|
|
|
except (TypeError, AttributeError, UnsupportedOperation): |
|
|
|
length = None |
|
|
|
|
|
|
|
body = data |
|
|
|
|
|
|
|
if getattr(body, 'tell', None) is not None: |
|
|
@ -916,7 +918,7 @@ class Response(object): |
|
|
|
return l |
|
|
|
|
|
|
|
def raise_for_status(self): |
|
|
|
"""Raises stored :class:`HTTPError`, if one occurred.""" |
|
|
|
"""Raises :class:`HTTPError`, if one occurred.""" |
|
|
|
|
|
|
|
http_error_msg = '' |
|
|
|
if isinstance(self.reason, bytes): |
|
|
|