Skip to content

Request

Request

Bases: Generic[TResponse], ABC

A description of an HTTP request.

path abstractmethod property

path: str

The path part of the URL.

body property

body: list | dict | None

An optional body of the request.

Defaults to None.

headers property

headers: list[tuple[str, str]]

HTTP headers to include in the request.

Defaults to empty list.

method property

method: HttpMethod

The HTTP method to use.

Defaults to HttpMethod.GET.

map_response abstractmethod

map_response(response: str) -> TResponse

Map raw response text to an object.

Parameters:

Name Type Description Default
response str

The raw response text.

required

Returns:

Type Description
TResponse

The mapped response object.

TResponse module-attribute

TResponse = TypeVar('TResponse')