harp.http.requests

Inheritance diagram of harp.http.requests

class HttpRequest[source]

Bases: BaseHttpMessage

__init__(impl=None, *, extensions=None, **kwargs)[source]
Parameters:
async aread()[source]

Read all chunks from request. We may want to be able to read partial body later, but for now it’s all or nothing. This method does nothing if the body has already been read.

Return type:

bytes

property basic_auth: tuple[str, str] | None

Parse and returns basic auth from headers.

property body: bytes

Returns the previously read body of the request. Raises a RuntimeError if the body has not been read yet, you must await the read() asynchronous method first, which cannot be done here because properties are synchronous, so we let the user explicitely call it before.

property cookies: dict
created_at: datetime
property headers: CIMultiDict
kind: str = 'request'
property stream