NNG_HTTP_REQ_SET_HEADER(3http)
π
nng_http_req_set_header(3http) β set HTTP request header π
okay bestie, welcome to the NNG Reference Manual β this page is all about setting one HTTP request header, and it is lowkey iconic for how much it does with so little. π
πΈ NAME πΈ
nng_http_req_set_header β set HTTP request header β¨
π¦ SYNOPSIS π¦
#include <nng/nng.h>
#include <nng/supplemental/http/http.h>
int nng_http_req_set_header(nng_http_req *req, const char *key,
const char *val);
β¨ DESCRIPTION β¨
So nng_http_req_set_header() sets the HTTP header for the request req and the key to the val. The key and val are copied. Any previous header with the same key is replaced. slay, it's giving overwrite energy π
Tip β Seenng_http_req_add_header()to add additional headers with the samekeywithout replacing them. iykyk π«Ά
The value of key is case insensitive, and should not include the final colon in an HTTP header. For example, specifying Host or hOSt are equivalent, whereas the value Host: is not a legal header key. no cap, that colon is not invited to the function π
π₯ RETURN VALUES π₯
This function returns 0 on success, and non-zero otherwise. so: 0 = slay, anything else = bestie check the vibes π
π ERRORS π
NNG_ENOMEMβ Insufficient memory to perform the operation. πNNG_ENOTSUPβ No support for HTTP in the library. π
π SEE ALSO π
go peek at these besties next, fr fr:
nng_http_req_alloc(3http)nng_http_req_add_header(3http)nng_http_req_del_header(3http)nng_http_req_get_header(3http)nng(7)
okay that's the whole page, bestie β from the NNG Reference Manual, dated 2026-01-13, under the page title NNG_HTTP_...SET_HEADER(3http) π
β¨π«Ά
π¦ where this page comes from
- alpine 3.24: nng-doc 1.11-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms