Skip to content

HTTPParser

[Source]

This is the HTTP parser that builds a message Payload object representing either a Request or a Response from received chunks of data.

class ref HTTPParser

Constructors

request

[Source]

Expect HTTP requests to arrive on a session.

new ref request(
  session': HTTPSession tag)
: HTTPParser ref^

Parameters

Returns


response

[Source]

Expect HTTP responses to arrive on a session.

new ref response(
  session': HTTPSession tag)
: HTTPParser ref^

Parameters

Returns


Public Functions

parse

[Source]

Analyze new data based on the parser's current internal state.

fun ref parse(
  buffer: Reader ref)
: (ParseError val | None val)

Parameters

Returns


restart

[Source]

Restart parser state for the next message. It will be of the same kind as the last one.

fun ref restart()
: None val

Returns


closed

[Source]

The connection has closed, which may signal that all remaining data is the payload body.

fun ref closed(
  buffer: Reader ref)
: None val

Parameters

Returns