Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

HeadersParser unstable

Low-level parser for multipart header blocks.

6 exports Since v4.0.0 Source

Constructors

make

unstable
Since v4.0.0

Creates an incremental multipart header parser.

Signature

declare const make: () => (chunk: Uint8Array, start: number) => ReturnValue

Errors

Failure

interface unstable
Since v4.0.0

A multipart header parsing failure.

Signature

interface Failure {
readonly _tag: "Failure";
readonly headers: Record<string, string | Array<string>>;
readonly reason: FailureReason;
}

FailureReason

type unstable
Since v4.0.0

The reason a multipart header block could not be parsed.

Signature

type FailureReason = "TooManyHeaders" | "HeaderTooLarge" | "InvalidHeaderName" | "InvalidHeaderValue"

Models

Continue

interface unstable
Since v4.0.0

Indicates that the parser needs more input.

Signature

interface Continue {
readonly _tag: "Continue";
}

Headers

interface unstable
Since v4.0.0

A successfully parsed multipart header block.

Signature

interface Headers {
readonly _tag: "Headers";
readonly endPosition: number;
readonly headers: Record<string, string | Array<string>>;
}

ReturnValue

type unstable
Since v4.0.0

The result of parsing a multipart header block.

Signature

type ReturnValue = Continue | Failure | Headers