http_writer

Http related parsers and protocol.

Module Contents

Classes

StreamWriter(self,protocol,loop,on_chunk_sent=None)

Functions

_py_serialize_headers(status_line,headers)
class StreamWriter(protocol, loop, on_chunk_sent=None)
__init__(protocol, loop, on_chunk_sent=None)
transport()
protocol()
enable_chunking()
enable_compression(encoding="deflate")
_write(chunk)
write(chunk)

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.

write_headers(status_line, headers)

Write request/response status and headers.

write_eof(chunk=None)
drain()

Flush the write buffer.

The intended use is to write

await w.write(data) await w.drain()
_py_serialize_headers(status_line, headers)