harp.asgi.bridge.requests

Inheritance diagram of harp.asgi.bridge.requests

class HttpRequestAsgiBridge[source]

Bases: HttpRequestBridge

Actually implements the getters required by HttpRequest using the asgi scope and receive callable. It is still an early implementation and will need to support streaming requests in the future.

Parameters:
__init__(scope, receive)[source]
Parameters:
get_headers()[source]

Get the headers from asgi scope, as a case-insensitive multidict.

Return type:

CIMultiDict

get_method()[source]

Get the HTTP method from asgi scope.

Return type:

str

get_path()[source]

Get the HTTP path from asgi scope (/foo/bar), without the query string part.

Return type:

str

get_query()[source]

Get the query string from asgi scope, as a multidict.

Return type:

MultiDict

get_server_ipaddr()[source]

Get the server IP address from asgi scope.

Return type:

str | None

get_server_port()[source]

Get the server port from asgi scope.

Return type:

int | None

get_stream()[source]

Get the request body stream from asgi receive callable.

Return type:

AsyncByteStream