alexapy.aiohttp.web
¶
Functions¶
middleware()
: Undocumented.normalize_path_middleware()
: Middleware factory which produces a middleware that normalizesjson_response()
: Undocumented.delete()
: Undocumented.get()
: Undocumented.head()
: Undocumented.options()
: Undocumented.patch()
: Undocumented.post()
: Undocumented.put()
: Undocumented.route()
: Undocumented.static()
: Undocumented.view()
: Undocumented.run_app()
: Run an app locally
- alexapy.aiohttp.web.middleware(f: alexapy.aiohttp.web_middlewares._Func) alexapy.aiohttp.web_middlewares._Func ¶
- alexapy.aiohttp.web.normalize_path_middleware(*, append_slash: bool = True, remove_slash: bool = False, merge_slashes: bool = True, redirect_class: typing.Type[alexapy.aiohttp.web_exceptions._HTTPMove] = <class 'alexapy.aiohttp.web_exceptions.HTTPPermanentRedirect'>) Callable[[alexapy.aiohttp.web_request.Request, Callable[[alexapy.aiohttp.web_request.Request], Awaitable[alexapy.aiohttp.web_response.StreamResponse]]], Awaitable[alexapy.aiohttp.web_response.StreamResponse]] ¶
Factory for producing a middleware that normalizes the path of a request.
- Normalizing means:
Add or remove a trailing slash to the path.
Double slashes are replaced by one.
The middleware returns as soon as it finds a path that resolves correctly. The order if both merge and append/remove are enabled is
merge slashes
append/remove slash
both merge slashes and append/remove slash.
If the path resolves with at least one of those conditions, it will redirect to the new path.
Only one of append_slash and remove_slash can be enabled. If both are True the factory will raise an assertion error
If append_slash is True the middleware will append a slash when needed. If a resource is defined with trailing slash and the request comes without it, it will append it automatically.
If remove_slash is True, append_slash must be False. When enabled the middleware will remove trailing slashes and redirect if the resource is defined
If merge_slashes is True, merge multiple consecutive slashes in the path into one.
- alexapy.aiohttp.web.json_response(data: typing.Any = <object object>, *, text: typing.Optional[str] = None, body: typing.Optional[bytes] = None, status: int = 200, reason: typing.Optional[str] = None, headers: typing.Optional[typing.Union[typing.Mapping[typing.Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, content_type: str = 'application/json', dumps: typing.Callable[[typing.Any], str] = <function dumps>) alexapy.aiohttp.web_response.Response ¶
- alexapy.aiohttp.web.delete(path: str, handler: Union[Type[alexapy.aiohttp.abc.AbstractView], Callable[[None], Awaitable[None]]], **kwargs: Any) alexapy.aiohttp.web_routedef.RouteDef ¶
- alexapy.aiohttp.web.get(path: str, handler: Union[Type[alexapy.aiohttp.abc.AbstractView], Callable[[None], Awaitable[None]]], *, name: Optional[str] = None, allow_head: bool = True, **kwargs: Any) alexapy.aiohttp.web_routedef.RouteDef ¶
- alexapy.aiohttp.web.head(path: str, handler: Union[Type[alexapy.aiohttp.abc.AbstractView], Callable[[None], Awaitable[None]]], **kwargs: Any) alexapy.aiohttp.web_routedef.RouteDef ¶
- alexapy.aiohttp.web.options(path: str, handler: Union[Type[alexapy.aiohttp.abc.AbstractView], Callable[[None], Awaitable[None]]], **kwargs: Any) alexapy.aiohttp.web_routedef.RouteDef ¶
- alexapy.aiohttp.web.patch(path: str, handler: Union[Type[alexapy.aiohttp.abc.AbstractView], Callable[[None], Awaitable[None]]], **kwargs: Any) alexapy.aiohttp.web_routedef.RouteDef ¶
- alexapy.aiohttp.web.post(path: str, handler: Union[Type[alexapy.aiohttp.abc.AbstractView], Callable[[None], Awaitable[None]]], **kwargs: Any) alexapy.aiohttp.web_routedef.RouteDef ¶
- alexapy.aiohttp.web.put(path: str, handler: Union[Type[alexapy.aiohttp.abc.AbstractView], Callable[[None], Awaitable[None]]], **kwargs: Any) alexapy.aiohttp.web_routedef.RouteDef ¶
- alexapy.aiohttp.web.route(method: str, path: str, handler: Union[Type[alexapy.aiohttp.abc.AbstractView], Callable[[None], Awaitable[None]]], **kwargs: Any) alexapy.aiohttp.web_routedef.RouteDef ¶
- alexapy.aiohttp.web.static(prefix: str, path: Union[str, os.PathLike[str]], **kwargs: Any) alexapy.aiohttp.web_routedef.StaticDef ¶
- alexapy.aiohttp.web.view(path: str, handler: Type[alexapy.aiohttp.abc.AbstractView], **kwargs: Any) alexapy.aiohttp.web_routedef.RouteDef ¶
- alexapy.aiohttp.web.run_app(app: typing.Union[alexapy.aiohttp.web_app.Application, typing.Awaitable[alexapy.aiohttp.web_app.Application]], *, host: typing.Optional[typing.Union[str, typing.Iterable[str]]] = None, port: typing.Optional[int] = None, path: typing.Optional[str] = None, sock: typing.Optional[socket.socket] = None, shutdown_timeout: float = 60.0, keepalive_timeout: float = 75.0, ssl_context: typing.Optional[ssl.SSLContext] = None, print: typing.Callable[[...], None] = <built-in function print>, backlog: int = 128, access_log_class: typing.Type[alexapy.aiohttp.abc.AbstractAccessLogger] = <class 'alexapy.aiohttp.web_log.AccessLogger'>, access_log_format: str = '%a %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"', access_log: typing.Optional[logging.Logger] = <Logger aiohttp.access (WARNING)>, handle_signals: bool = True, reuse_address: typing.Optional[bool] = None, reuse_port: typing.Optional[bool] = None, loop: typing.Optional[asyncio.events.AbstractEventLoop] = None) None ¶
Run an app locally
Classes¶
Application
: Abstract base class for generic types.FileResponse
: A response object can be used to send files.RequestHandler
: HTTP protocol implementation.BaseRequest
: Abstract base class for generic types.FileField
: Undocumented.Request
: Abstract base class for generic types.ContentCoding
: An enumeration.Response
: Undocumented.StreamResponse
: Undocumented.AbstractRouteDef
: Helper class that provides a standard way to create an ABC usingRouteDef
: Helper class that provides a standard way to create an ABC usingRouteTableDef
: Route definition tableStaticDef
: Helper class that provides a standard way to create an ABC usingAppRunner
: Web Application runnerBaseRunner
: Helper class that provides a standard way to create an ABC usingBaseSite
: Helper class that provides a standard way to create an ABC usingGracefulExit
: Request to exit from the interpreter.ServerRunner
: Low-level web server runnerSockSite
: Helper class that provides a standard way to create an ABC usingTCPSite
: Helper class that provides a standard way to create an ABC usingUnixSite
: Helper class that provides a standard way to create an ABC usingNamedPipeSite
: Helper class that provides a standard way to create an ABC usingServer
: Undocumented.AbstractResource
: Abstract base class for generic types.AbstractRoute
: Helper class that provides a standard way to create an ABC usingDynamicResource
: Abstract base class for generic types.PlainResource
: Abstract base class for generic types.Resource
: Abstract base class for generic types.ResourceRoute
: A route with resourceStaticResource
: Abstract base class for generic types.UrlDispatcher
: Helper class that provides a standard way to create an ABC usingUrlMappingMatchInfo
: dict() -> new empty dictionaryView
: Abstract class based view.WebSocketReady
: Undocumented.WebSocketResponse
: Undocumented.WSMsgType
: An enumeration.
- class alexapy.aiohttp.web.Application(*, logger: logging.Logger = <Logger aiohttp.web (WARNING)>, router: typing.Optional[alexapy.aiohttp.web_urldispatcher.UrlDispatcher] = None, middlewares: typing.Iterable[typing.Callable] = (), handler_args: typing.Optional[typing.Mapping[str, typing.Any]] = None, client_max_size: int = 1048576, loop: typing.Optional[asyncio.events.AbstractEventLoop] = None, debug: typing.Any = Ellipsis)¶
Inheritance
- __call__() alexapy.aiohttp.web_app.Application ¶
gunicorn compatibility
- async cleanup() None ¶
Causes on_cleanup signal
Should be called after shutdown()
- async shutdown() None ¶
Causes on_shutdown signal
Should be called before cleanup()
- async startup() None ¶
Causes on_startup signal
Should be called in the event loop along with the request handler.
- class alexapy.aiohttp.web.FileResponse(path: Union[str, pathlib.Path], chunk_size: int = 262144, status: int = 200, reason: Optional[str] = None, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None)¶
A response object can be used to send files.
Inheritance
- class alexapy.aiohttp.web.RequestHandler(manager: Server, *, loop: asyncio.events.AbstractEventLoop, keepalive_timeout: float = 75.0, tcp_keepalive: bool = True, logger: logging.Logger = <Logger aiohttp.server (WARNING)>, access_log_class: typing.Type[alexapy.aiohttp.abc.AbstractAccessLogger] = <class 'alexapy.aiohttp.web_log.AccessLogger'>, access_log: logging.Logger = <Logger aiohttp.access (WARNING)>, access_log_format: str = '%a %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"', debug: bool = False, max_line_size: int = 8190, max_headers: int = 32768, max_field_size: int = 8190, lingering_time: float = 10.0, read_bufsize: int = 65536, auto_decompress: bool = True)¶
HTTP protocol implementation.
RequestHandler handles incoming HTTP request. It reads request line, request headers and request payload and calls handle_request() method. By default it always returns with 404 response.
RequestHandler handles errors in incoming request, like bad status line, bad headers or incomplete payload. If any error occurs, connection gets closed.
- keepalive_timeout – number of seconds before closing
keep-alive connection
tcp_keepalive – TCP keep-alive is on, default is on
debug – enable debug mode
logger – custom logger object
access_log_class – custom class for access_logger
access_log – custom logging object
access_log_format – access log format string
loop – Optional event loop
max_line_size – Optional maximum header line size
max_field_size – Optional maximum header field size
max_headers – Optional maximum header size
Inheritance
- close() None ¶
Close connection.
Stop accepting new pipelining messages and close connection when handlers done processing messages.
- connection_lost(exc: Optional[BaseException]) None ¶
Called when the connection is lost or closed.
The argument is an exception object or None (the latter meaning a regular EOF is received or the connection was aborted or closed).
- connection_made(transport: asyncio.transports.BaseTransport) None ¶
Called when a connection is made.
The argument is the transport representing the pipe connection. To receive data, wait for data_received() calls. When the connection is closed, connection_lost() is called.
- data_received(data: bytes) None ¶
Called when some data is received.
The argument is a bytes object.
- eof_received() None ¶
Called when the other end calls write_eof() or equivalent.
If this returns a false value (including None), the transport will close itself. If it returns a true value, closing the transport is up to the protocol.
- async finish_response(request: alexapy.aiohttp.web_request.BaseRequest, resp: alexapy.aiohttp.web_response.StreamResponse, start_time: float) bool ¶
Prepare the response and write_eof, then log access.
This has to be called within the context of any exception so the access logger can get exception information. Returns True if the client disconnects prematurely.
- force_close() None ¶
Forcefully close connection.
- handle_error(request: alexapy.aiohttp.web_request.BaseRequest, status: int = 500, exc: Optional[BaseException] = None, message: Optional[str] = None) alexapy.aiohttp.web_response.StreamResponse ¶
Handle errors.
Returns HTTP response with specific status code. Logs additional information. It always closes current connection.
- keep_alive(val: bool) None ¶
Set keep-alive connection mode.
- Parameters
val (bool) – new state.
- async shutdown(timeout: Optional[float] = 15.0) None ¶
Do worker process exit preparations.
We need to clean up everything and stop accepting requests. It is especially important for keep-alive connections.
- async start() None ¶
Process incoming request.
It reads request line, request headers and request payload, then calls handle_request() method. Subclass has to override handle_request(). start() handles various exceptions in request or response handling. Connection is being closed always unless keep_alive(True) specified.
- class alexapy.aiohttp.web.BaseRequest(message: alexapy.aiohttp.http_parser.RawRequestMessage, payload: alexapy.aiohttp.streams.StreamReader, protocol: RequestHandler, payload_writer: alexapy.aiohttp.abc.AbstractStreamWriter, task: asyncio.Task[None], loop: asyncio.events.AbstractEventLoop, *, client_max_size: int = 1048576, state: Optional[Dict[str, Any]] = None, scheme: Optional[str] = None, host: Optional[str] = None, remote: Optional[str] = None)¶
Inheritance
- body_exists¶
Return True if request has HTTP BODY, False otherwise.
- property can_read_body: bool¶
Return True if request’s HTTP BODY can be read, False otherwise.
- clone(*, method: str = <object object>, rel_url: typing.Union[str, yarl.URL] = <object object>, headers: typing.Union[typing.Mapping[typing.Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy] = <object object>, scheme: str = <object object>, host: str = <object object>, remote: str = <object object>) alexapy.aiohttp.web_request.BaseRequest ¶
Clone itself with replacement some attributes.
Creates and returns a new instance of Request object. If no parameters are given, an exact copy is returned. If a parameter is not passed, it will reuse the one from the current request object.
- content¶
Return raw payload stream.
- cookies¶
Return request cookies.
A read-only dictionary-like object.
- forwarded¶
A tuple containing all parsed Forwarded header(s).
Makes an effort to parse Forwarded headers as specified by RFC 7239:
It adds one (immutable) dictionary per Forwarded ‘field-value’, ie per proxy. The element corresponds to the data in the Forwarded field-value added by the first proxy encountered by the client. Each subsequent item corresponds to those added by later proxies.
It checks that every value has valid syntax in general as specified in section 4: either a ‘token’ or a ‘quoted-string’.
It un-escapes found escape sequences.
It does NOT validate ‘by’ and ‘for’ contents as specified in section 6.
It does NOT validate ‘host’ contents (Host ABNF).
It does NOT validate ‘proto’ contents for valid URI scheme names.
Returns a tuple containing one or more immutable dicts
- get_extra_info(name: str, default: Optional[Any] = None) Any ¶
Extra info from protocol transport
- property has_body: bool¶
Return True if request’s HTTP BODY can be read, False otherwise.
- headers¶
A case-insensitive multidict proxy with all headers.
- host¶
Hostname of the request.
Hostname is resolved in this order:
overridden value by .clone(host=new_host) call.
HOST HTTP header
socket.getfqdn() value
- http_range¶
The content of Range HTTP header.
Return a slice instance.
- if_match¶
The value of If-Match HTTP header, or None.
This header is represented as a tuple of ETag objects.
- if_modified_since¶
The value of If-Modified-Since HTTP header, or None.
This header is represented as a datetime object.
- if_none_match¶
The value of If-None-Match HTTP header, or None.
This header is represented as a tuple of ETag objects.
- if_range¶
The value of If-Range HTTP header, or None.
This header is represented as a datetime object.
- if_unmodified_since¶
The value of If-Unmodified-Since HTTP header, or None.
This header is represented as a datetime object.
- async json(*, loads: typing.Callable[[str], typing.Any] = <function loads>) Any ¶
Return BODY as JSON.
- keep_alive¶
Is keepalive enabled by client?
- method¶
Read only property for getting HTTP method.
The value is upper-cased str like ‘GET’, ‘POST’, ‘PUT’ etc.
- async multipart() alexapy.aiohttp.multipart.MultipartReader ¶
Return async iterator to process BODY as multipart.
- path¶
The URL including PATH INFO without the host or scheme.
E.g.,
/app/blog
- path_qs¶
The URL including PATH_INFO and the query string.
E.g, /app/blog?id=10
- async post() multidict._multidict.MultiDictProxy ¶
Return POST parameters.
- query¶
A multidict with all the variables in the query string.
- query_string¶
The query string in the URL.
E.g., id=10
- raw_headers¶
A sequence of pairs for all headers.
- raw_path¶
The URL including raw PATH INFO without the host or scheme.
Warning, the path is unquoted and may contains non valid URL characters
E.g.,
/my%2Fpath%7Cwith%21some%25strange%24characters
- async read() bytes ¶
Read request body if present.
Returns bytes object with full request content.
- async release() None ¶
Release request.
Eat unread part of HTTP BODY if present.
- remote¶
Remote IP of client initiated HTTP request.
The IP is resolved in this order:
overridden value by .clone(remote=new_remote) call.
peername of opened socket
- scheme¶
A string representing the scheme of the request.
Hostname is resolved in this order:
overridden value by .clone(scheme=new_scheme) call.
type of connection to peer: HTTPS if socket is SSL, HTTP otherwise.
‘http’ or ‘https’.
- secure¶
A bool indicating if the request is handled with SSL.
- async text() str ¶
Return BODY as text using encoding from .charset.
- version¶
Read only property for getting HTTP version of request.
Returns aiohttp.protocol.HttpVersion instance.
- class alexapy.aiohttp.web.FileField(name: str, filename: str, file: _io.BufferedReader, content_type: str, headers: multidict._multidict.CIMultiDictProxy)¶
Inheritance
- class alexapy.aiohttp.web.Request(*args: Any, **kwargs: Any)¶
Inheritance
- property app: Application¶
Application instance.
- clone(*, method: str = <object object>, rel_url: typing.Union[str, yarl.URL] = <object object>, headers: typing.Union[typing.Mapping[typing.Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy] = <object object>, scheme: str = <object object>, host: str = <object object>, remote: str = <object object>) alexapy.aiohttp.web_request.Request ¶
Clone itself with replacement some attributes.
Creates and returns a new instance of Request object. If no parameters are given, an exact copy is returned. If a parameter is not passed, it will reuse the one from the current request object.
- match_info¶
Result of route resolving.
- class alexapy.aiohttp.web.ContentCoding(value)¶
An enumeration.
Inheritance
- class alexapy.aiohttp.web.Response(*, body: Optional[Any] = None, status: int = 200, reason: Optional[str] = None, text: Optional[str] = None, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, content_type: Optional[str] = None, charset: Optional[str] = None, zlib_executor_size: Optional[int] = None, zlib_executor: Optional[concurrent.futures._base.Executor] = None)¶
Inheritance
- property content_length: Optional[int]¶
The value of Content-Length HTTP header.
- class alexapy.aiohttp.web.StreamResponse(*, status: int = 200, reason: Optional[str] = None, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None)¶
Inheritance
- property charset: Optional[str]¶
The value of charset part for Content-Type HTTP header.
- property content_length: Optional[int]¶
The value of Content-Length HTTP header.
- property content_type: str¶
The value of content part for Content-Type HTTP header.
- del_cookie(name: str, *, domain: Optional[str] = None, path: str = '/') None ¶
Delete cookie.
Creates new empty expired cookie.
- enable_chunked_encoding(chunk_size: Optional[int] = None) None ¶
Enables automatic chunked transfer encoding.
- enable_compression(force: Optional[Union[bool, alexapy.aiohttp.web_response.ContentCoding]] = None) None ¶
Enables response compression encoding.
- property last_modified: Optional[datetime.datetime]¶
The value of Last-Modified HTTP header, or None.
This header is represented as a datetime object.
- set_cookie(name: str, value: str, *, expires: Optional[str] = None, domain: Optional[str] = None, max_age: Optional[Union[int, str]] = None, path: str = '/', secure: Optional[bool] = None, httponly: Optional[bool] = None, version: Optional[str] = None, samesite: Optional[str] = None) None ¶
Set or update response cookie.
Sets new cookie or updates existent with new value. Also updates only those params which are not None.
- class alexapy.aiohttp.web.AbstractRouteDef¶
Inheritance
- abstract register(router: None) List[None] ¶
Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
- class alexapy.aiohttp.web.RouteDef(method: str, path: str, handler: Union[Type[alexapy.aiohttp.abc.AbstractView], Callable[[None], Awaitable[None]]], kwargs: Dict[str, Any])¶
Inheritance
- register(router: None) List[None] ¶
Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
- class alexapy.aiohttp.web.RouteTableDef¶
Route definition table
Inheritance
- class alexapy.aiohttp.web.StaticDef(prefix: str, path: Union[str, os.PathLike[str]], kwargs: Dict[str, Any])¶
Inheritance
- register(router: None) List[None] ¶
Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
- class alexapy.aiohttp.web.AppRunner(app: alexapy.aiohttp.web_app.Application, *, handle_signals: bool = False, **kwargs: Any)¶
Web Application runner
Inheritance
- class alexapy.aiohttp.web.BaseRunner(*, handle_signals: bool = False, **kwargs: Any)¶
Inheritance
- class alexapy.aiohttp.web.BaseSite(runner: alexapy.aiohttp.web_runner.BaseRunner, *, shutdown_timeout: float = 60.0, ssl_context: Optional[ssl.SSLContext] = None, backlog: int = 128)¶
Inheritance
- class alexapy.aiohttp.web.GracefulExit¶
Inheritance
- class alexapy.aiohttp.web.ServerRunner(web_server: alexapy.aiohttp.web_server.Server, *, handle_signals: bool = False, **kwargs: Any)¶
Low-level web server runner
Inheritance
- class alexapy.aiohttp.web.SockSite(runner: alexapy.aiohttp.web_runner.BaseRunner, sock: socket.socket, *, shutdown_timeout: float = 60.0, ssl_context: Optional[ssl.SSLContext] = None, backlog: int = 128)¶
Inheritance
- class alexapy.aiohttp.web.TCPSite(runner: alexapy.aiohttp.web_runner.BaseRunner, host: Optional[str] = None, port: Optional[int] = None, *, shutdown_timeout: float = 60.0, ssl_context: Optional[ssl.SSLContext] = None, backlog: int = 128, reuse_address: Optional[bool] = None, reuse_port: Optional[bool] = None)¶
Inheritance
- class alexapy.aiohttp.web.UnixSite(runner: alexapy.aiohttp.web_runner.BaseRunner, path: str, *, shutdown_timeout: float = 60.0, ssl_context: Optional[ssl.SSLContext] = None, backlog: int = 128)¶
Inheritance
- class alexapy.aiohttp.web.NamedPipeSite(runner: alexapy.aiohttp.web_runner.BaseRunner, path: str, *, shutdown_timeout: float = 60.0)¶
Inheritance
- class alexapy.aiohttp.web.Server(handler: Callable[[alexapy.aiohttp.web_request.BaseRequest], Awaitable[alexapy.aiohttp.web_response.StreamResponse]], *, request_factory: Optional[Callable[[alexapy.aiohttp.http_parser.RawRequestMessage, alexapy.aiohttp.streams.StreamReader, RequestHandler, alexapy.aiohttp.abc.AbstractStreamWriter, asyncio.Task[None]], alexapy.aiohttp.web_request.BaseRequest]] = None, loop: Optional[asyncio.events.AbstractEventLoop] = None, **kwargs: Any)¶
Inheritance
- class alexapy.aiohttp.web.AbstractResource(*, name: Optional[str] = None)¶
Inheritance
- abstract add_prefix(prefix: str) None ¶
Add a prefix to processed URLs.
Required for subapplications support.
- abstract property canonical: str¶
Exposes the resource’s canonical path.
For example ‘/foo/bar/{name}’
- abstract get_info() alexapy.aiohttp.web_urldispatcher._InfoDict ¶
Return a dict with additional info useful for introspection
- abstract raw_match(path: str) bool ¶
Perform a raw match against path
- abstract async resolve(request: alexapy.aiohttp.web_request.Request) Tuple[Optional[alexapy.aiohttp.web_urldispatcher.UrlMappingMatchInfo], Set[str]] ¶
Resolve resource.
Return (UrlMappingMatchInfo, allowed_methods) pair.
- abstract url_for(**kwargs: str) yarl.URL ¶
Construct url for resource with additional params.
- class alexapy.aiohttp.web.AbstractRoute(method: str, handler: Union[Callable[[alexapy.aiohttp.web_request.Request], Awaitable[alexapy.aiohttp.web_response.StreamResponse]], Type[alexapy.aiohttp.abc.AbstractView]], *, expect_handler: Optional[Callable[[alexapy.aiohttp.web_request.Request], Awaitable[None]]] = None, resource: Optional[alexapy.aiohttp.web_urldispatcher.AbstractResource] = None)¶
Inheritance
- abstract get_info() alexapy.aiohttp.web_urldispatcher._InfoDict ¶
Return a dict with additional info useful for introspection
- abstract property name: Optional[str]¶
Optional route’s name, always equals to resource’s name.
- abstract url_for(*args: str, **kwargs: str) yarl.URL ¶
Construct url for route with additional params.
- class alexapy.aiohttp.web.DynamicResource(path: str, *, name: Optional[str] = None)¶
Inheritance
- add_prefix(prefix: str) None ¶
Add a prefix to processed URLs.
Required for subapplications support.
- property canonical: str¶
Exposes the resource’s canonical path.
For example ‘/foo/bar/{name}’
- get_info() alexapy.aiohttp.web_urldispatcher._InfoDict ¶
Return a dict with additional info useful for introspection
- raw_match(path: str) bool ¶
Perform a raw match against path
- url_for(**parts: str) yarl.URL ¶
Construct url for resource with additional params.
- class alexapy.aiohttp.web.PlainResource(path: str, *, name: Optional[str] = None)¶
Inheritance
- add_prefix(prefix: str) None ¶
Add a prefix to processed URLs.
Required for subapplications support.
- property canonical: str¶
Exposes the resource’s canonical path.
For example ‘/foo/bar/{name}’
- get_info() alexapy.aiohttp.web_urldispatcher._InfoDict ¶
Return a dict with additional info useful for introspection
- raw_match(path: str) bool ¶
Perform a raw match against path
- url_for() yarl.URL ¶
Construct url for resource with additional params.
- class alexapy.aiohttp.web.Resource(*, name: Optional[str] = None)¶
Inheritance
- async resolve(request: alexapy.aiohttp.web_request.Request) Tuple[Optional[alexapy.aiohttp.web_urldispatcher.UrlMappingMatchInfo], Set[str]] ¶
Resolve resource.
Return (UrlMappingMatchInfo, allowed_methods) pair.
- class alexapy.aiohttp.web.ResourceRoute(method: str, handler: Union[Callable[[alexapy.aiohttp.web_request.Request], Awaitable[alexapy.aiohttp.web_response.StreamResponse]], Type[alexapy.aiohttp.abc.AbstractView]], resource: alexapy.aiohttp.web_urldispatcher.AbstractResource, *, expect_handler: Optional[Callable[[alexapy.aiohttp.web_request.Request], Awaitable[None]]] = None)¶
A route with resource
Inheritance
- get_info() alexapy.aiohttp.web_urldispatcher._InfoDict ¶
Return a dict with additional info useful for introspection
- property name: Optional[str]¶
Optional route’s name, always equals to resource’s name.
- url_for(*args: str, **kwargs: str) yarl.URL ¶
Construct url for route with additional params.
- class alexapy.aiohttp.web.StaticResource(prefix: str, directory: Union[str, os.PathLike[str]], *, name: Optional[str] = None, expect_handler: Optional[Callable[[alexapy.aiohttp.web_request.Request], Awaitable[None]]] = None, chunk_size: int = 262144, show_index: bool = False, follow_symlinks: bool = False, append_version: bool = False)¶
Inheritance
- get_info() alexapy.aiohttp.web_urldispatcher._InfoDict ¶
Return a dict with additional info useful for introspection
- async resolve(request: alexapy.aiohttp.web_request.Request) Tuple[Optional[alexapy.aiohttp.web_urldispatcher.UrlMappingMatchInfo], Set[str]] ¶
Resolve resource.
Return (UrlMappingMatchInfo, allowed_methods) pair.
- url_for(*, filename: Union[str, pathlib.Path], append_version: Optional[bool] = None) yarl.URL ¶
Construct url for resource with additional params.
- class alexapy.aiohttp.web.UrlDispatcher¶
Inheritance
- add_delete(path: str, handler: Callable[[alexapy.aiohttp.web_request.Request], Awaitable[alexapy.aiohttp.web_response.StreamResponse]], **kwargs: Any) alexapy.aiohttp.web_urldispatcher.AbstractRoute ¶
Shortcut for add_route with method DELETE.
- add_get(path: str, handler: Callable[[alexapy.aiohttp.web_request.Request], Awaitable[alexapy.aiohttp.web_response.StreamResponse]], *, name: Optional[str] = None, allow_head: bool = True, **kwargs: Any) alexapy.aiohttp.web_urldispatcher.AbstractRoute ¶
Shortcut for add_route with method GET.
If allow_head is true, another route is added allowing head requests to the same endpoint.
- add_head(path: str, handler: Callable[[alexapy.aiohttp.web_request.Request], Awaitable[alexapy.aiohttp.web_response.StreamResponse]], **kwargs: Any) alexapy.aiohttp.web_urldispatcher.AbstractRoute ¶
Shortcut for add_route with method HEAD.
- add_options(path: str, handler: Callable[[alexapy.aiohttp.web_request.Request], Awaitable[alexapy.aiohttp.web_response.StreamResponse]], **kwargs: Any) alexapy.aiohttp.web_urldispatcher.AbstractRoute ¶
Shortcut for add_route with method OPTIONS.
- add_patch(path: str, handler: Callable[[alexapy.aiohttp.web_request.Request], Awaitable[alexapy.aiohttp.web_response.StreamResponse]], **kwargs: Any) alexapy.aiohttp.web_urldispatcher.AbstractRoute ¶
Shortcut for add_route with method PATCH.
- add_post(path: str, handler: Callable[[alexapy.aiohttp.web_request.Request], Awaitable[alexapy.aiohttp.web_response.StreamResponse]], **kwargs: Any) alexapy.aiohttp.web_urldispatcher.AbstractRoute ¶
Shortcut for add_route with method POST.
- add_put(path: str, handler: Callable[[alexapy.aiohttp.web_request.Request], Awaitable[alexapy.aiohttp.web_response.StreamResponse]], **kwargs: Any) alexapy.aiohttp.web_urldispatcher.AbstractRoute ¶
Shortcut for add_route with method PUT.
- add_routes(routes: Iterable[alexapy.aiohttp.web_routedef.AbstractRouteDef]) List[alexapy.aiohttp.web_urldispatcher.AbstractRoute] ¶
Append routes to route table.
Parameter should be a sequence of RouteDef objects.
Returns a list of registered AbstractRoute instances.
- add_static(prefix: str, path: Union[str, os.PathLike[str]], *, name: Optional[str] = None, expect_handler: Optional[Callable[[alexapy.aiohttp.web_request.Request], Awaitable[None]]] = None, chunk_size: int = 262144, show_index: bool = False, follow_symlinks: bool = False, append_version: bool = False) alexapy.aiohttp.web_urldispatcher.AbstractResource ¶
Add static files view.
prefix - url prefix path - folder with files
- add_view(path: str, handler: Type[alexapy.aiohttp.abc.AbstractView], **kwargs: Any) alexapy.aiohttp.web_urldispatcher.AbstractRoute ¶
Shortcut for add_route with ANY methods for a class-based view.
- freeze() None ¶
Freeze router.
- async resolve(request: alexapy.aiohttp.web_request.Request) alexapy.aiohttp.web_urldispatcher.UrlMappingMatchInfo ¶
Return MATCH_INFO for given request
- class alexapy.aiohttp.web.UrlMappingMatchInfo(match_dict: Dict[str, str], route: alexapy.aiohttp.web_urldispatcher.AbstractRoute)¶
Inheritance
- add_app(app: Application) None ¶
Add application to the nested apps stack.
- property apps: Tuple[Application, ...]¶
Stack of nested applications.
Top level application is left-most element.
- property expect_handler: Callable[[alexapy.aiohttp.web_request.Request], Awaitable[None]]¶
Expect handler for 100-continue processing
- freeze() None ¶
Freeze the match info.
The method is called after route resolution.
After the call .add_app() is forbidden.
- get_info() alexapy.aiohttp.web_urldispatcher._InfoDict ¶
Return a dict with additional info useful for introspection
- property handler: Callable[[alexapy.aiohttp.web_request.Request], Awaitable[alexapy.aiohttp.web_response.StreamResponse]]¶
Execute matched request handler
- property http_exception: Optional[alexapy.aiohttp.web_exceptions.HTTPException]¶
HTTPException instance raised on router’s resolving, or None
- class alexapy.aiohttp.web.View(request: None)¶
Inheritance
- class alexapy.aiohttp.web.WebSocketReady(ok: bool, protocol: Optional[str])¶
Inheritance
- class alexapy.aiohttp.web.WebSocketResponse(*, timeout: float = 10.0, receive_timeout: Optional[float] = None, autoclose: bool = True, autoping: bool = True, heartbeat: Optional[float] = None, protocols: Iterable[str] = (), compress: bool = True, max_msg_size: int = 4194304)¶
Inheritance
- class alexapy.aiohttp.web.WSMsgType(value)¶
An enumeration.
Inheritance
Exceptions¶
CleanupError
: Unspecified run-time error.HTTPAccepted
: Base class for exceptions with status codes in the 200s.HTTPBadGateway
: Base class for exceptions with status codes in the 400s and 500s.HTTPBadRequest
: Base class for exceptions with status codes in the 400s and 500s.HTTPClientError
: Base class for exceptions with status codes in the 400s and 500s.HTTPConflict
: Base class for exceptions with status codes in the 400s and 500s.HTTPCreated
: Base class for exceptions with status codes in the 200s.HTTPError
: Base class for exceptions with status codes in the 400s and 500s.HTTPException
: Common base class for all non-exit exceptions.HTTPExpectationFailed
: Base class for exceptions with status codes in the 400s and 500s.HTTPFailedDependency
: Base class for exceptions with status codes in the 400s and 500s.HTTPForbidden
: Base class for exceptions with status codes in the 400s and 500s.HTTPFound
: Base class for exceptions with status codes in the 300s.HTTPGatewayTimeout
: Base class for exceptions with status codes in the 400s and 500s.HTTPGone
: Base class for exceptions with status codes in the 400s and 500s.HTTPInsufficientStorage
: Base class for exceptions with status codes in the 400s and 500s.HTTPInternalServerError
: Base class for exceptions with status codes in the 400s and 500s.HTTPLengthRequired
: Base class for exceptions with status codes in the 400s and 500s.HTTPMethodNotAllowed
: Base class for exceptions with status codes in the 400s and 500s.HTTPMisdirectedRequest
: Base class for exceptions with status codes in the 400s and 500s.HTTPMovedPermanently
: Base class for exceptions with status codes in the 300s.HTTPMultipleChoices
: Base class for exceptions with status codes in the 300s.HTTPNetworkAuthenticationRequired
: Base class for exceptions with status codes in the 400s and 500s.HTTPNoContent
: Base class for exceptions with status codes in the 200s.HTTPNonAuthoritativeInformation
: Base class for exceptions with status codes in the 200s.HTTPNotAcceptable
: Base class for exceptions with status codes in the 400s and 500s.HTTPNotExtended
: Base class for exceptions with status codes in the 400s and 500s.HTTPNotFound
: Base class for exceptions with status codes in the 400s and 500s.HTTPNotImplemented
: Base class for exceptions with status codes in the 400s and 500s.HTTPNotModified
: Base class for exceptions with status codes in the 300s.HTTPOk
: Base class for exceptions with status codes in the 200s.HTTPPartialContent
: Base class for exceptions with status codes in the 200s.HTTPPaymentRequired
: Base class for exceptions with status codes in the 400s and 500s.HTTPPermanentRedirect
: Base class for exceptions with status codes in the 300s.HTTPPreconditionFailed
: Base class for exceptions with status codes in the 400s and 500s.HTTPPreconditionRequired
: Base class for exceptions with status codes in the 400s and 500s.HTTPProxyAuthenticationRequired
: Base class for exceptions with status codes in the 400s and 500s.HTTPRedirection
: Base class for exceptions with status codes in the 300s.HTTPRequestEntityTooLarge
: Base class for exceptions with status codes in the 400s and 500s.HTTPRequestHeaderFieldsTooLarge
: Base class for exceptions with status codes in the 400s and 500s.HTTPRequestRangeNotSatisfiable
: Base class for exceptions with status codes in the 400s and 500s.HTTPRequestTimeout
: Base class for exceptions with status codes in the 400s and 500s.HTTPRequestURITooLong
: Base class for exceptions with status codes in the 400s and 500s.HTTPResetContent
: Base class for exceptions with status codes in the 200s.HTTPSeeOther
: Base class for exceptions with status codes in the 300s.HTTPServerError
: Base class for exceptions with status codes in the 400s and 500s.HTTPServiceUnavailable
: Base class for exceptions with status codes in the 400s and 500s.HTTPSuccessful
: Base class for exceptions with status codes in the 200s.HTTPTemporaryRedirect
: Base class for exceptions with status codes in the 300s.HTTPTooManyRequests
: Base class for exceptions with status codes in the 400s and 500s.HTTPUnauthorized
: Base class for exceptions with status codes in the 400s and 500s.HTTPUnavailableForLegalReasons
: Base class for exceptions with status codes in the 400s and 500s.HTTPUnprocessableEntity
: Base class for exceptions with status codes in the 400s and 500s.HTTPUnsupportedMediaType
: Base class for exceptions with status codes in the 400s and 500s.HTTPUpgradeRequired
: Base class for exceptions with status codes in the 400s and 500s.HTTPUseProxy
: Base class for exceptions with status codes in the 300s.HTTPVariantAlsoNegotiates
: Base class for exceptions with status codes in the 400s and 500s.HTTPVersionNotSupported
: Base class for exceptions with status codes in the 400s and 500s.PayloadAccessError
: Payload was accessed after response was sent.RequestPayloadError
: Payload parsing error.
- exception alexapy.aiohttp.web.CleanupError¶
Inheritance
- exception alexapy.aiohttp.web.HTTPAccepted(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPBadGateway(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPBadRequest(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPClientError(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPConflict(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPCreated(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPError(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Base class for exceptions with status codes in the 400s and 500s.
Inheritance
- exception alexapy.aiohttp.web.HTTPException(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPExpectationFailed(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPFailedDependency(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPForbidden(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPFound(location: Union[str, yarl.URL], *, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPGatewayTimeout(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPGone(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPInsufficientStorage(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPInternalServerError(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPLengthRequired(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPMethodNotAllowed(method: str, allowed_methods: Iterable[str], *, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPMisdirectedRequest(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPMovedPermanently(location: Union[str, yarl.URL], *, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPMultipleChoices(location: Union[str, yarl.URL], *, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPNetworkAuthenticationRequired(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPNoContent(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPNonAuthoritativeInformation(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPNotAcceptable(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPNotExtended(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPNotFound(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPNotImplemented(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPNotModified(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPOk(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPPartialContent(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPPaymentRequired(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPPermanentRedirect(location: Union[str, yarl.URL], *, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPPreconditionFailed(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPPreconditionRequired(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPProxyAuthenticationRequired(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPRedirection(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Base class for exceptions with status codes in the 300s.
Inheritance
- exception alexapy.aiohttp.web.HTTPRequestEntityTooLarge(max_size: float, actual_size: float, **kwargs: Any)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPRequestHeaderFieldsTooLarge(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPRequestRangeNotSatisfiable(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPRequestTimeout(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPRequestURITooLong(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPResetContent(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPSeeOther(location: Union[str, yarl.URL], *, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPServerError(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
Inheritance
- exception alexapy.aiohttp.web.HTTPSuccessful(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Base class for exceptions with status codes in the 200s.
Inheritance
- exception alexapy.aiohttp.web.HTTPTemporaryRedirect(location: Union[str, yarl.URL], *, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPTooManyRequests(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPUnauthorized(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
Inheritance
- exception alexapy.aiohttp.web.HTTPUnprocessableEntity(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPUnsupportedMediaType(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPUpgradeRequired(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPUseProxy(location: Union[str, yarl.URL], *, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPVariantAlsoNegotiates(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.HTTPVersionNotSupported(*, headers: Optional[Union[Mapping[Union[str, multidict._multidict.istr], str], multidict._multidict.CIMultiDict, multidict._multidict.CIMultiDictProxy]] = None, reason: Optional[str] = None, body: Optional[Any] = None, text: Optional[str] = None, content_type: Optional[str] = None)¶
Inheritance
- exception alexapy.aiohttp.web.PayloadAccessError¶
Payload was accessed after response was sent.
Inheritance
- exception alexapy.aiohttp.web.RequestPayloadError¶
Payload parsing error.
Inheritance