HttpResponseInit
Description
Initialize an empty HttpResponse. Inside a Scope the allocator argument may be omitted (uses MisraScope).
Success
Returns an HttpResponse with content_type and status_code set to their invalid sentinels, an empty headers Vec wired for deep-copy element ownership, and an empty body.
Failure
Macro cannot fail (pure literal expansion).
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Http.c:39:
Allocator *alloc_base = ALLOCATOR_OF(&alloc);
HttpResponse response = HttpResponseInit(alloc_base);
Str body = StrInit(alloc_base);
StrAppendFmt(&body, "<h1>hi</h1>");
Last updated on