A HTTP response waiting to be sent.

                              [/ <----------------------------------- \]

Order of operations: accept -> wait -> do [ -> write -> finish][ -> reset /] \ -> read /

Fields

version: http.Version = .HTTP/1.1,
status: http.Status = .ok,
reason: ?[]const u8 = null,
transfer_encoding: ResponseTransfer = .none,
allocator: Allocator,
address: net.Address,
connection: Connection,
headers: http.Headers,
request: Request,
state: State = .first,

Types

Functions

fn deinit(res: *Response) void

No documentation provided.

fn do(res: *Response) !void

Send the response headers.

fn finish(res: *Response) FinishError!void

Finish the body of a request. This notifies the server that you have no more dat…

Finish the body of a request. This notifies the server that you have no more data to send.

fn read(res: *Response, buffer: []u8) ReadError!usize

No documentation provided.

fn readAll(res: *Response, buffer: []u8) !usize

No documentation provided.

fn reader(res: *Response) Reader

No documentation provided.

fn reset(res: *Response) ResetState

Reset this response to its initial state. This must be called before handling a …

Reset this response to its initial state. This must be called before handling a second request on the same connection.

fn transferReader(res: *Response) TransferReader

No documentation provided.

fn wait(res: *Response) WaitError!void

Wait for the client to send a complete request head.

fn write(res: *Response, bytes: []const u8) WriteError!usize

Write bytes to the server. The transfer_encoding request header determines h…

Write bytes to the server. The transfer_encoding request header determines how data will be sent.

fn writeAll(req: *Response, bytes: []const u8) WriteError!void

No documentation provided.

fn writer(res: *Response) Writer

No documentation provided.

Values