alexapy.aiohttp.web_response

Functions

alexapy.aiohttp.web_response.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

Classes

class alexapy.aiohttp.web_response.ContentCoding(value)

An enumeration.

Inheritance

Inheritance diagram of ContentCoding

class alexapy.aiohttp.web_response.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

Inheritance diagram of StreamResponse

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.

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 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_response.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

Inheritance diagram of Response

property content_length: Optional[int]

The value of Content-Length HTTP header.