latest.ipv8.REST.base_endpoint

Module Contents

Classes

BaseEndpoint

Base class for all REST endpoints.

Response

A convenience class to auto-encode response bodies in JSON format.

Attributes

HTTP_BAD_REQUEST

HTTP_UNAUTHORIZED

HTTP_NOT_FOUND

HTTP_CONFLICT

HTTP_PRECONDITION_FAILED

HTTP_INTERNAL_SERVER_ERROR

DEFAULT_HEADERS

T

MiddleWaresType

latest.ipv8.REST.base_endpoint.HTTP_BAD_REQUEST = 400
latest.ipv8.REST.base_endpoint.HTTP_UNAUTHORIZED = 401
latest.ipv8.REST.base_endpoint.HTTP_NOT_FOUND = 404
latest.ipv8.REST.base_endpoint.HTTP_CONFLICT = 409
latest.ipv8.REST.base_endpoint.HTTP_PRECONDITION_FAILED = 412
latest.ipv8.REST.base_endpoint.HTTP_INTERNAL_SERVER_ERROR = 500
latest.ipv8.REST.base_endpoint.DEFAULT_HEADERS: dict[str, str]
latest.ipv8.REST.base_endpoint.T
latest.ipv8.REST.base_endpoint.MiddleWaresType
class latest.ipv8.REST.base_endpoint.BaseEndpoint(middlewares: MiddleWaresType = ())

Bases: Generic[T]

Base class for all REST endpoints.

setup_routes() None

Register the names to make this endpoint callable.

initialize(session: T) None

Initialize this endpoint for the given session instance.

add_endpoint(prefix: str, endpoint: BaseEndpoint) None

Add a new child endpoint to this endpoint.

class latest.ipv8.REST.base_endpoint.Response(body: Any = None, headers: aiohttp.typedefs.LooseHeaders | None = None, content_type: str | None = None, status: int = 200, **kwargs)

Bases: aiohttp.web.Response

A convenience class to auto-encode response bodies in JSON format.