NNG_HTTP_RES_GET_DATA(3http)
π 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 byres, and it will automatically be freed when the request is freed. So it's not yours to free, bestie β that'sres'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
- 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