NNG_HTTP_RES_DEL_HEADER(3http)

πŸ“¦ version 1.11, in alpine 3.24

πŸ’… 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 key key was 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 πŸ‘‘

(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