HTTP Tools

Resiliparse HTTP payload parsing utilities API documentation.

resiliparse.parse.http.iterate_http_chunks(reader)

Generator wrapping read_http_chunk() for fully consuming a chunked HTTP payload.

Parameters

reader (fastwarc.stream_io.BufferedReader) – input reader

Returns

generator of chunks

Return type

t.Generator[bytes]

resiliparse.parse.http.read_http_chunk(reader)

Helper function for reading chunked HTTP payloads.

Each call to this function will try to read the next chunk. In case of an error or EOF, an empty byte string will be returned.

Parameters

reader (fastwarc.stream_io.BufferedReader) – input reader

Returns

contents of the next chunk or empty string if EOF

Return type

bytes