DoxigAlpha

receiveHead

Function parameters

Parameters

#
s:*Server

Type definitions in this namespace

Types

#
WebSocket
See https://tools.ietf.org/html/rfc6455

Initialize an HTTP server that can respond to multiple requests on the same

Functions

#
init
Initialize an HTTP server that can respond to multiple requests on the same

Error sets in this namespace

Error Sets

#

Source

Implementation

#
pub fn receiveHead(s: *Server) ReceiveHeadError!Request {
    const head_buffer = try s.reader.receiveHead();
    return .{
        .server = s,
        .head_buffer = head_buffer,
        // No need to track the returned error here since users can repeat the
        // parse with the header buffer to get detailed diagnostics.
        .head = Request.Head.parse(head_buffer) catch return error.HttpHeadersInvalid,
    };
}