6 Struct n_http_request
gullradriel edited this page 2026-10-25 10:46:33 +01:00

n_http_request

Module: HTTP/1.1 REQUEST HEAD: strict, bounded parser

A parsed request head. More...

#include "n_http_req.h"

Public Attributes

Name
int version_minor
char[2048u+1] path
size_t nb_headers
n_http_req_method method
n_http_req_header[64u] headers
size_t head_len
long long content_length
char[256u+1] authorization

Detailed Description

struct n_http_request;

A parsed request head.

path is the origin-form target (leading '/', query included, fragment rejected). content_length is the declared body length (0 when there is no Content-Length header). head_len is the byte offset just past the terminating CRLFCRLF, where the body begins in the caller's buffer. authorization is the Authorization header value, empty if absent; an over-long value errors the whole request rather than truncating. version_minor is 0 for HTTP/1.0, 1 for HTTP/1.1. headers[0..nb_headers) lists every header line in arrival order (offsets into the parsed buffer, read them with n_http_request_header()).

Public Attributes Documentation

variable version_minor

int version_minor;

variable path

char[2048u+1] path;

variable nb_headers

size_t nb_headers;

variable method

n_http_req_method method;

variable headers

n_http_req_header[64u] headers;

variable head_len

size_t head_len;

variable content_length

long long content_length;

variable authorization

char[256u+1] authorization;