2.12.ipv8.REST.base_endpoint

Module Contents

Classes

Attributes

2.12.ipv8.REST.base_endpoint.HTTP_BAD_REQUEST = 400
2.12.ipv8.REST.base_endpoint.HTTP_UNAUTHORIZED = 401
2.12.ipv8.REST.base_endpoint.HTTP_NOT_FOUND = 404
2.12.ipv8.REST.base_endpoint.HTTP_CONFLICT = 409
2.12.ipv8.REST.base_endpoint.HTTP_PRECONDITION_FAILED = 412
2.12.ipv8.REST.base_endpoint.HTTP_INTERNAL_SERVER_ERROR = 500
2.12.ipv8.REST.base_endpoint.DEFAULT_HEADERS: dict[str, str]
2.12.ipv8.REST.base_endpoint.T
2.12.ipv8.REST.base_endpoint.MiddleWaresType
class 2.12.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 2.12.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.