1#pragma once
 2
 3#include <pw_types.h>
 4
 5#ifdef __cplusplus
 6extern "C" {
 7#endif
 8
 9[[nodiscard]] bool cgi_get_request_headers(PwValuePtr request_headers);
10/*
11 * Re-construct request header from environment variables.
12 * Variables that start from `HTTP_` are transformed to capitalized names separated with dash,
13 * e.g. `HTTP_CONTENT_TYPE` -> `Content-Type`
14 *
15 * CGI variables are that come from request headers are transformed in the same way,
16 * e.g. `CONTENT_TYPE` -> `Content-Type`
17 *
18 * CGI-specific variables, e.g. `GATEWAY_INTERFACE` are added as is.
19 */
20
21[[nodiscard]] bool cgi_load_request(PwValuePtr request_headers, PwValuePtr result);
22/*
23 * Load and parse request data from stdin.
24 */
25
26#ifdef __cplusplus
27}
28#endif