Skip to content

HTTPResponse

[Source]

A buffered HTTP response containing status, headers, and the complete body.

HTTPResponse is the result of collecting streaming response callbacks into a single object. Use ResponseCollector to accumulate on_response() and on_body_chunk() data, then call build() to produce an HTTPResponse.

The entire body is held in memory as a contiguous Array[U8] val. For large responses where memory is a concern, use the raw on_body_chunk() callbacks directly instead of collecting.

class val HTTPResponse

Constructors

create

[Source]

Create a buffered HTTP response with all fields.

new val create(
  version': ((HTTP10 val | HTTP11 val) & _Version val),
  status': U16 val,
  reason': String val,
  headers': Headers val,
  body': Array[U8 val] val)
: HTTPResponse val^

Parameters

Returns


Public fields

let version: ((HTTP10 val | HTTP11 val) & _Version val)

[Source]


let status: U16 val

[Source]


let reason: String val

[Source]


let headers: Headers val

[Source]


let body: Array[U8 val] val

[Source]