MCPcopy Create free account
hub / github.com/psf/cachecontrol / _loads_v4

Method _loads_v4

cachecontrol/serialize.py:135–146  ·  view source on GitHub ↗
(
        self,
        request: PreparedRequest,
        data: bytes,
        body_file: IO[bytes] | None = None,
    )

Source from the content-addressed store, hash-verified

133 return HTTPResponse(body=body, preload_content=False, **cached["response"])
134
135 def _loads_v4(
136 self,
137 request: PreparedRequest,
138 data: bytes,
139 body_file: IO[bytes] | None = None,
140 ) -> HTTPResponse | None:
141 try:
142 cached = msgpack.loads(data, raw=False)
143 except ValueError:
144 return None
145
146 return self.prepare_response(request, cached, body_file)

Callers 2

loadsMethod · 0.95
test_read_version_v4Method · 0.80

Calls 2

prepare_responseMethod · 0.95
loadsMethod · 0.45

Tested by 1

test_read_version_v4Method · 0.64