HTTPResponse¶
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.
Constructors¶
create¶
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¶
- version': ((HTTP10 val | HTTP11 val) & _Version val)
- status': U16 val
- reason': String val
- headers': Headers val
- body': Array[U8 val] val
Returns¶
- HTTPResponse val^