HttpRequest
Description
Parsed HTTP request. Carries the allocator that owns url and headers; all sub-allocations route through the same handle.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Http.c:19:
"body-bytes";
HttpRequest req = HttpRequestInit(alloc_base);
const char *next = HttpRequestParse(&req, raw);- In
Http.c:102:
}
const char *HttpRequestParse(HttpRequest *req, const char *in) {
if (!req || !req->allocator || !in) {
LOG_FATAL("invalid arguments");- In
Http.c:161:
}
void HttpRequestDeinit(HttpRequest *req) {
if (!req) {
LOG_FATAL("invalid arguments");- In
Http.h:202:
Str url;
HttpHeaders headers;
} HttpRequest;
///
- In
Http.h:215:
#define HttpRequestInit_0() HttpRequestInit_1(MisraScope)
#define HttpRequestInit_1(alloc_ptr) \
((HttpRequest) {.allocator = ALLOCATOR_OF(alloc_ptr), \
.method = HTTP_REQUEST_METHOD_UNKNOWN, \
.url = StrInit_1(alloc_ptr), \- In
Http.h:229:
/// FAILURE : Returns `in` unchanged when the input is malformed.
///
const char *HttpRequestParse(HttpRequest *req, const char *in);
///
- In
Http.h:235:
/// a partially-parsed request.
///
void HttpRequestDeinit(HttpRequest *req);
///
- In
Beam.c:60:
StrPushBackZstr(&raw, prefix_bytes);
HttpRequest req = HttpRequestInit(scope);
const char *end = HttpRequestParse(&req, raw.data);
if (end == raw.data) {
Last updated on