NNG_HTTP_REQ_SET_URI(3http)
π NAME π
nng_http_req_set_uri β so you wanna set the URI on an HTTP request? bestie, this is literally the function for that β¨
πΈ SYNOPSIS πΈ
#include <nng/nng.h>
#include <nng/supplemental/http/http.h>
int nng_http_req_set_uri(nng_http_req *req, const char *uri);
π¦ DESCRIPTION π¦
okay so nng_http_req_set_uri() sets the Request-URI that's chillin' on the request req, and it sets it to uri. no cap, that's the whole vibe π«Ά
and like β the uri you pass in should contain precisely the string that's gonna get sent to the HTTP server in the request. including any query information or fragment. all of it, every last crumb, don't leave anything out π
the function makes a local copy of the uri inside the request req, so your string is safely tucked away π
β οΈ note β οΈ β no validation or canonicalization of the uri is performed. like, zero. none. it takes you at your word, so maybe double-check yourself before you wreck yourself π
π‘ tip π‘ β you can get validation and canonicalization if you want it!nng_url_parse()is right there for you, and theu_requrimember will contain a suitable value that you can absolutely hand off to this function. slay π₯
β RETURN VALUES β
this function returns 0 on success, and non-zero otherwise. simple as that, bestie π
π ERRORS π
NNG_ENOMEMβ insufficient memory to perform the operation π like your computer said "nah, not today"NNG_ENOTSUPβ no support for HTTP in the library π the library literally doesn't do HTTP, sorry girl
π SEE ALSO π
iykyk, this page is from the NNG Reference Manual, dated 2026-01-13 β go off and set those URIs, main character π π
π¦ 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