Skip to content
Myr

Add copy method to PreparedRequest objects

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

authored by Ian Cordasco · committed by Ian Cordasco · parent d83919a · Browse files · 1 file+10 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

1 file+10 added−1 removed

  • other:+10 added−1 removed

1 file+10 added−1 removed

modified:requests/models.py+10 added-1 removed
23 unmodified lines
24 guess_filename, get_auth_from_url, requote_uri,25 stream_decode_response_unicode, to_key_val_list, parse_header_links,26 iter_slices, guess_json_utf, super_len)27from .compat import (28 cookielib, urlparse, urlunparse, urlsplit, urlencode, str, bytes, StringIO,28 cookielib, urlunparse, urlsplit, urlencode, str, bytes, StringIO,29 is_py2, chardet, json, builtin_str, basestring)3031CONTENT_CHUNK_SIZE = 10 * 102432ITER_CHUNK_SIZE = 512
233 unmodified lines
266267 def __repr__(self):268 return '<PreparedRequest [%s]>' % (self.method)269270 def copy(self):271 p = PreparedRequest()272 p.method = self.method273 p.url = self.url274 p.headers = self.headers275 p.body = self.body276 p.hooks = self.hooks277 return p278279 def prepare_method(self, method):280 """Prepares the given HTTP method."""281 self.method = method282 if self.method is not None:
420 unmodified lines