NNG_HTTP_REQ_DEL_HEADER(3http)

πŸ“¦ version 1.11, in alpine 3.24

πŸ’… nng_http_req_del_header β€” delete HTTP request header

okay bestie so this is from the NNG Reference Manual and it's literally the page about yeeting headers out of an HTTP request. stay with me, it's short and it slays πŸŽ€


✨ NAME ✨

nng_http_req_del_header β€” delete HTTP request header

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <nng/nng.h>
#include <nng/supplemental/http/http.h>

int nng_http_req_del_header(nng_http_req *req, const char *key);

🌸 DESCRIPTION 🌸

So like, the way that nng_http_req_del_header() works is: it removes all the HTTP headers that have the associated key from the request structure req. all of them. not just the first one you find. the whole squad, gone πŸ’€

And the value of key? case insensitive. lowercase, uppercase, chaos-caps, doesn't matter. but β€” and this is the important part β€” it 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. so like... don't do that πŸ™ˆ no colon, babe. the colon stays out of it. periodt.

πŸ‘‘ RETURN VALUES πŸ‘‘

This function returns 0 on success, and non-zero otherwise. that's it, that's the vibe check ✨

πŸ”₯ ERRORS πŸ”₯

  • NNG_ENOENT β€” no header with the key key was present. it looked. it found nothing. 😭
  • NNG_ENOTSUP β€” no support for HTTP in the library. like, the whole feature just isn't there, ngl.

🌈 SEE ALSO 🌈

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)

(yes it links itself in SEE ALSO, and honestly? main character energy. we love a self-referential icon πŸ’…)


so there you have it bestie β€” go forth and delete those headers 🫢

sign-off szn: this lil masterpiece dropped 2026-01-13 as part of the NNG Reference Manual (NNG_HTTP_...DEL_HEADER(3http), for the record-keepers) β€” mwah, stan this manpage β­πŸ§šπŸ’œ

πŸ“¦ where this page comes from