protocol.http.chunked Module

Chunked transfer encoding.

class wpull.protocol.http.chunked.ChunkedTransferReader(connection, read_size=4096)[source]

Bases: object

Read chunked transfer encoded stream.

Parameters:connection (connection.Connection) – Established connection.
read_chunk_body()[source]

Read a fragment of a single chunk.

Call read_chunk_header() first.

Returns:2-item tuple with the content data and raw data. First item is empty bytes string when chunk is fully read.
Return type:tuple

Coroutine.

read_chunk_header()[source]

Read a single chunk’s header.

Returns:2-item tuple with the size of the content in the chunk and the raw header byte string.
Return type:tuple

Coroutine.

read_trailer()[source]

Read the HTTP trailer fields.

Returns:The trailer data.
Return type:bytes

Coroutine.