NNG_HTTP_RES_GET_DATA(3http)

πŸ“¦ version 1.11, in alpine 3.24

πŸŽ€ NAME πŸŽ€

nng_http_res_get_data β€” get HTTP response body.

Okay bestie, welcome to NNG_HTTP_RES_GET_DATA(3http) from the NNG Reference Manual. This is the page for grabbing that HTTP body, and yes, it's exactly as iconic as it sounds. ✨

✨ SYNOPSIS ✨

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

void nng_http_res_get_data(nng_http_res *res, void **bodyp, size_t *sizep);

This is literally the whole call, no cap. 🫢

πŸ’– DESCRIPTION πŸ’–

So nng_http_res_get_data() gets the HTTP body associated with the request res, storing a pointer to the buffer at the location referenced by bodyp, and the length of the associated buffer at the location referenced by sizep. It's giving "two outputs, one call" energy. πŸ’…

Note: the buffer you get back is owned by res, and it will automatically be freed when the request is freed. So it's not yours to free, bestie β€” that's res's job. πŸ”₯

🌈 RETURN VALUES 🌈

None. Zero. Nada. It's a void function, so it doesn't return anything β€” it just fills in your bodyp and sizep and ghosts. 😭

πŸ’€ ERRORS πŸ’€

None. No errors, no drama, no spicy failure modes listed here. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

Yep, nng_http_req_copy_data(3http) is listed twice β€” that's the original vibe, and I'm keeping it exactly. πŸ’…


That's the whole page, bestie! 🫢 Signing off from NNG_HTTP_RES_GET_DATA(3http) in the NNG Reference Manual, dated 2026-01-13 β€” go get that HTTP body and slay. βœ¨πŸ’–

πŸ“¦ where this page comes from