← index

[HTTP]ServerResponse

inherits Object · defined at net/http_server.qn:76

An outbound response under construction: status, #(name value) header pairs, and a body — nil, Bytes (a String converts for convenience), or a Generator whose yields (String | Bytes) stream to the peer as chunked transfer-encoding. The setters return self so calls can be threaded. The [Web] layer aliases and reopens this class with its builder conveniences.

Class methods

reasonFor:

The canonical reason phrase for a status code ('' when unregistered — the phrase is display-only and an empty one is legal on the wire).

net/http_server.qn:87

Instance methods

body

The body as set: nil, Bytes, or a Generator (streamed as chunked output).

net/http_server.qn:134

body:

Set the body — a String converts to its UTF-8 Bytes; Bytes or a Generator pass through; returns self.

net/http_server.qn:144

contentType:

Append a Content-Type header; returns self.

net/http_server.qn:141

header: value:

Append one header pair; returns self.

net/http_server.qn:139

headers

The header #(name value) pairs added so far.

net/http_server.qn:132

init:

Internal: defaults — status 200, empty headers, nil body.

net/http_server.qn:78

s

Human rendering: the status code.

net/http_server.qn:151

status

The status code to be sent.

net/http_server.qn:130

status:

Set the status code; returns self.

net/http_server.qn:137