Request

class requests_cache.models.request.CachedRequest(body=None, cookies=NOTHING, headers=NOTHING, method=None, url=None)[source]

Bases: object

A serializable dataclass that emulates requests.PreparedResponse

Parameters
body
cookies
copy()[source]

Return a copy of the CachedRequest

Return type

CachedRequest

classmethod from_request(original_request)[source]

Create a CachedRequest based on an original request object

Parameters

original_request (PreparedRequest) –

Return type

CachedRequest

headers
method
prepare()[source]

Convert the CachedRequest back into a PreparedRequest

Return type

PreparedRequest

url