Skip to content

HTTPRequest

[Source]

An HTTP request to be sent by HTTPClientConnection.

Holds the method, path, headers, and optional body. The connection layer auto-sets Host and Content-Length headers during serialization if they are not already present — callers only need to set them explicitly when overriding the defaults.

No validation is performed on the request — the client sends whatever the caller asks for.

class val HTTPRequest

Constructors

create

[Source]

Create an HTTP request with the given method, path, headers, and body.

new val create(
  method': Method val,
  path': String val,
  headers': Headers val = recover,
  body': (Array[U8 val] val | None val) = reference)
: HTTPRequest val^

Parameters

Returns


Public fields

let method: Method val

[Source]


let path: String val

[Source]


let headers: Headers val

[Source]


let body: (Array[U8 val] val | None val)

[Source]