NNG_HTTP_RES_GET_REASON(3http)

πŸ“¦ version 1.11, in alpine 3.24

πŸ’… nng_http_res_get_reason β€” return HTTP response reason

okay bestie, welcome to the NNG Reference Manual, section 3http πŸ¦‹ β€” today's main character is nng_http_res_get_reason, and honestly? she's lowkey the easiest function in the whole HTTP family. no cap.


✨ SYNOPSIS ✨

like, just include these two things first, mwah πŸŽ€

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

const char *nng_http_res_get_reason(nng_http_res *res);

🌸 DESCRIPTION 🌸

so the way that nng_http_res_get_reason() works is it hands you back a string β€” like, an actual string β€” that represents the reason associated with the response res πŸ’–.

and what even is a reason, you ask? it's the human-readable explanation of the status code that you would get from nng_http_res_get_status(). that's a mouthful but it's literally just the cute little text next to the number, y'know? the vibe check that comes with the code 🫢 iykyk.


πŸ‘‘ RETURN VALUES πŸ‘‘

Reason as a string. that's it. that's the whole section. slay πŸ’…


πŸ’€ ERRORS πŸ’€

None.

not me having nothing to report 😭 like literally zero errors, she simply cannot fail. iconic behaviour fr fr ✨


🌈 SEE ALSO 🌈

go read those next, bestie, they're the friend group of this function and they all ate πŸ”₯


okay that's the whole page, 2026-01-13 energy, brought to you by the NNG Reference Manual and this NNG_HTTP_...GET_REASON(3http) header up top πŸ§šπŸ’œ bye bye, go get that reason string ⭐

πŸ“¦ where this page comes from