pub fn respond(
request: *Request,
content: []const u8,
options: RespondOptions,
) ExpectContinueError!void request: *Requestcontent: []const u8options: RespondOptions323
324
325
326
327
328
329
330 pub fn respond(
request: *Request,
content: []const u8,
options: RespondOptions,
) ExpectContinueError!void {
try respondUnflushed(request, content, options);
try request.server.out.flush();
}
Send an entire HTTP response to the client, including headers and body.
Automatically handles HEAD requests by omitting the body.
Unless
transfer_encodingis specified, uses the "content-length" header.If the request contains a body and the connection is to be reused, discards the request body, leaving the Server in the
readystate. If this discarding fails, the connection is marked as not to be reused and no error is surfaced.Asserts status is not
continue. Asserts that "\r\n" does not occur in any header name or value.