HttpRequestInit
Description
Initialize an empty HttpRequest. Inside a Scope the allocator argument may be omitted (uses MisraScope).
Success
Returns an HttpRequest with method set to HTTP_REQUEST_METHOD_UNKNOWN, empty url, and an empty headers Vec that takes ownership of inserted headers by move (freed per-element by HttpRequestDeinit).
Failure
Macro cannot fail (pure literal expansion).
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Beam.c:252:
StrPushBackMany(&raw, prefix_bytes);
HttpRequest req = HttpRequestInit(scope);
Zstr end = HttpRequestParse(&req, (Zstr)StrBegin(&raw));
if (end == StrBegin(&raw)) {- In
Http.Leak.c:90:
"\r\n";
HttpRequest req = HttpRequestInit(adbg);
Zstr next = HttpRequestParse(&req, raw);
bool ok = (next != raw) && (StrLen(&req.url) > 0);- In
Http.c:22:
"body-bytes";
HttpRequest req = HttpRequestInit(alloc_base);
Zstr next = HttpRequestParse(&req, raw);- In
Http.c:88:
bool ok = true;
for (u64 i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {
HttpRequest req = HttpRequestInit(alloc_base);
Zstr next = HttpRequestParse(&req, cases[i].raw);
ok = ok && (next != cases[i].raw) && (req.method == cases[i].method);- In
Http.c:112:
bool ok = true;
for (u64 i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {
HttpRequest req = HttpRequestInit(alloc_base);
Zstr next = HttpRequestParse(&req, cases[i]);
ok = ok && (next == cases[i]) && (req.method == HTTP_REQUEST_METHOD_UNKNOWN);- In
Http.c:135:
bool ok = true;
for (u64 i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {
HttpRequest req = HttpRequestInit(alloc_base);
Zstr next = HttpRequestParse(&req, cases[i]);
ok = ok && (next == cases[i]) && (req.method == HTTP_REQUEST_METHOD_UNKNOWN);- In
Http.c:163:
StrAppendFmt(&raw, "\r\n");
HttpRequest req = HttpRequestInit(alloc_base);
Zstr in = StrBegin(&raw);
Zstr next = HttpRequestParse(&req, in);- In
Http.c:190:
StrAppendFmt(&raw, "\r\n");
HttpRequest req = HttpRequestInit(alloc_base);
Zstr in = StrBegin(&raw);
Zstr next = HttpRequestParse(&req, in);
Last updated on