NNG_HTTP_RES_DEL_HEADER(3http)
π NNG_HTTP_RES_DEL_HEADER(3http) β bestie's guide to yeeting HTTP response headers
okay so this is a page from the NNG Reference Manual, and it's about one very specific little function that deletes headers off an HTTP response. short page, big slay. let's go π
β¨ NAME β¨
nng_http_res_del_header β delete HTTP response header ποΈ
like, the function's whole personality is "remove that header, bestie."
πΈ SYNOPSIS πΈ
#include <nng/nng.h>
#include <nng/supplemental/http/http.h>
int nng_http_res_del_header(nng_http_res *res, const char *key);
that's it. two includes, one call. iconic minimalism π
π¦ DESCRIPTION π¦
so nng_http_res_del_header() removes all the HTTP headers with the associated key from the response structure res. not just one β all of them with that key. it's a full clear-out, no survivors, main character energy π₯
the value of key is case insensitive, and it should not include the final colon that you'd see in an actual HTTP header. so for example, specifying Host or hOSt are equivalent β same header, same vibe, the case genuinely does not matter. but Host: is not a legal header key, because that trailing colon is not it π
periodt. leave the colon at home.
π RETURN VALUES π
this function returns 0 on success, and non-zero otherwise. zero is the good one, obviously. π«Ά
π₯ ERRORS π₯
NNG_ENOENTβ no header with the keykeywas present. nothing to delete, bestie, it's giving empty clipboard πNNG_ENOTSUPβ no support for HTTP in the library. the HTTP girlies simply did not show up to this build π
π SEE ALSO π
nng_http_res_alloc(3http)nng_http_res_add_header(3http)nng_http_res_del_header(3http)nng_http_res_get_header(3http)nng(7)
(yes, it references itself in SEE ALSO β self-love, we respect it π)
β cute little sign-off β
this page lives in the NNG Reference Manual, and it's dated 2026-01-13. go delete some headers, bestie β you're gonna slay π§π
π¦ 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