Documentation

Std.Http.Protocol.H1.Parser

This module defines parsers for HTTP/1.1 request and response lines, headers, and body framing. The reference used is https://httpwg.org/specs/rfc9112.html.

Parses a request line and returns a fully-typed Request.Head. request-line = method SP request-target SP HTTP-version

Instances For

    Parses a request line and returns the recognized HTTP method and version when available.

    request-line = method SP request-target SP HTTP-version

    Instances For

      Parses a single header field line, or returns none when it sees the blank line that terminates the header section.

      field-line = field-name ":" OWS field-value OWS CRLF
      
      Instances For

        Result of parsing partial or complete information.

        Instances For

          Parses fixed-size data that can be incomplete.

          Instances For

            Parses fixed-size chunk data that can be incomplete.

            Instances For

              Parses trailer headers after a chunked body and returns them as an array of name-value pairs.

              This is exposed for callers that need the trailer values directly (e.g. clients). The internal protocol machine uses parseLastChunkBody instead, which discards trailer values.

              Instances For

                Parses a status line and returns a fully-typed Response.Head. status-line = HTTP-version SP status-code SP [ reason-phrase ] Accepts only HTTP/1.1. For parsing where the version may be unrecognized and must be mapped to an error event, use parseStatusLineRawVersion.

                Instances For

                  Parses a status line and returns the status code plus recognized HTTP version when available. Consumes and discards the reason phrase.

                  status-line = HTTP-version SP status-code SP [ reason-phrase ] CRLF

                  Instances For

                    Parses the trailer section that follows the last chunk size line (0\r\n).

                    Instances For