Skip to content
Myr

Merge pull request #1476 from sigmavirus24/add_copy_to_prepared_requests

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

[2.0] Add copy method to PreparedRequest objects

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 3becc47, b84547d · Browse files · 1 file+9 added−0 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−0 removed

  • other:+9 added−0 removed

1 file+9 added−0 removed

modified:requests/models.py+9 added
265 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:
419 unmodified lines