MCPcopy
hub / github.com/psf/requests / copy

Method copy

src/requests/models.py:454–463  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

452 return f"<PreparedRequest [{self.method}]>"
453
454 def copy(self) -> PreparedRequest:
455 p = PreparedRequest()
456 p.method = self.method
457 p.url = self.url
458 p.headers = self.headers.copy() if self.headers is not None else None # type: ignore[assignment]
459 p._cookies = _copy_cookie_jar(self._cookies)
460 p.body = self.body
461 p.hooks = self.hooks
462 p._body_position = self._body_position
463 return p
464
465 def prepare_method(self, method: str | None) -> None:
466 """Prepares the given HTTP method."""

Callers 5

test_prepared_copyFunction · 0.95
handle_401Method · 0.45
resolve_proxiesFunction · 0.45
resolve_redirectsMethod · 0.45
test_copyMethod · 0.45

Calls 2

PreparedRequestClass · 0.85
_copy_cookie_jarFunction · 0.85

Tested by 2

test_prepared_copyFunction · 0.76
test_copyMethod · 0.36