A dataclass containing cached response information, used for serialization.
A StreamReader loaded from previously consumed response content.
Set some default CachedResponse values on a ClientResponse object, so they can be expected to always be present
- class CachedResponse(method, reason, status, url, version, body=b'', content=None, links=_Nothing.NOTHING, cookies=_Nothing.NOTHING, created_at=_Nothing.NOTHING, encoding='utf-8', expires=None, raw_headers=_Nothing.NOTHING, real_url=None, history=_Nothing.NOTHING, last_used=_Nothing.NOTHING)#
A dataclass containing cached response information, used for serialization. It will mostly behave the same as a
aiohttp.ClientResponsethat has been read, with some additional cache-related info.
url (URL) –
- property _released#
- property connection#
Get Content-Disposition headers, if any
- property from_cache#
- async classmethod from_client_response(client_response, expires=None)#
Convert a ClientResponse into a CachedReponse
- property headers: CIMultiDictProxy[str]#
Get headers as an immutable, case-insensitive multidict from raw headers
- async json(encoding=None, **kwargs)#
Read and decode JSON response
Convert stored links into the format returned by
Reset the stream reader to re-read a streamed response
- async start()#
- async terminate()#
- async text(encoding=None, errors='strict')#
Read response payload and decode
- async wait_for_close()#
- class CachedStreamReader(body=None)#
A StreamReader loaded from previously consumed response content. This feeds cached data into the stream so it can support all the same behavior as the original stream: async iteration, chunked reads, etc.