Skip to main content

parse_boundary_stream

Parse one and exactly one stream that encapsulates a boundary.

def parse_boundary_stream(
stream: Stream,
max_header_size: int
) - > tuple

Parse one and exactly one stream that encapsulates a boundary.

Parameters

NameTypeDescription
streamStreamThe input stream containing the multipart boundary data to be parsed.
max_header_sizeintThe maximum allowable size in bytes for the header section before raising a MultiPartParserError.

Returns

TypeDescription
tupleA tuple containing the detected part type (RAW, FIELD, or FILE), a dictionary of parsed header names and their parameters, and the remaining stream object.