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

Class MockResponse

src/requests/cookies.py:114–132  ·  view source on GitHub ↗

Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`. ...what? Basically, expose the parsed HTTP headers from the server response the way `http.cookiejar` expects to see them.

Source from the content-addressed store, hash-verified

112
113
114class MockResponse:
115 """Wraps a `httplib.HTTPMessage` to mimic a `urllib.addinfourl`.
116
117 ...what? Basically, expose the parsed HTTP headers from the server response
118 the way `http.cookiejar` expects to see them.
119 """
120
121 def __init__(self, headers: Any) -> None:
122 """Make a MockResponse for `cookiejar` to read.
123
124 :param headers: a httplib.HTTPMessage or analogous carrying the headers
125 """
126 self._headers = headers
127
128 def info(self) -> Any:
129 return self._headers
130
131 def getheaders(self, name: str) -> Any:
132 self._headers.getheaders(name)
133
134
135def extract_cookies_to_jar(

Callers 1

extract_cookies_to_jarFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected