alexapy.aiohttp.web_response
¶
Functions¶
json_response()
: Undocumented.
- 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¶
ContentCoding
: An enumeration.StreamResponse
: Undocumented.Response
: Undocumented.
- class alexapy.aiohttp.web_response.ContentCoding(value)¶
An enumeration.
Inheritance
- 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
- 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_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
- property content_length: Optional[int]¶
The value of Content-Length HTTP header.