alexapy.aiohttp.http_writer

Http related parsers and protocol.

Classes

class alexapy.aiohttp.http_writer.StreamWriter(protocol: alexapy.aiohttp.base_protocol.BaseProtocol, loop: asyncio.events.AbstractEventLoop, on_chunk_sent: Optional[Callable[[bytes], Awaitable[None]]] = None, on_headers_sent: Optional[Callable[[multidict._multidict.CIMultiDict], Awaitable[None]]] = None)

Inheritance

Inheritance diagram of StreamWriter

async drain() None

Flush the write buffer.

The intended use is to write

await w.write(data) await w.drain()

enable_chunking() None

Enable HTTP chunked mode

enable_compression(encoding: str = 'deflate', strategy: int = 0) None

Enable HTTP body compression

async write(chunk: bytes, *, drain: bool = True, LIMIT: int = 65536) None

Writes chunk of data to a stream.

write_eof() indicates end of stream. writer can’t be used after write_eof() method being called. write() return drain future.

async write_eof(chunk: bytes = b'') None

Write last chunk.

async write_headers(status_line: str, headers: multidict._multidict.CIMultiDict) None

Write request/response status and headers.

class alexapy.aiohttp.http_writer.HttpVersion(major, minor)

Inheritance

Inheritance diagram of HttpVersion

property major

Alias for field number 0

property minor

Alias for field number 1

Variables

alexapy.aiohttp.http_writer.HttpVersion10

HttpVersion(major, minor)

HttpVersion(major=1, minor=0)
alexapy.aiohttp.http_writer.HttpVersion11

HttpVersion(major, minor)

HttpVersion(major=1, minor=1)