NNG_HTTP_...T_VERSION(3http)
π NNG_HTTP_REQ_SET_VERSION(3http) π
okay so this is a page straight out of the NNG Reference Manual, bestie β welcome, pull up a chair, we're gonna talk about setting the HTTP protocol version on a request. it's giving very niche, very specific, but honestly kind of iconic? β¨
πΈ NAME πΈ
nng_http_req_set_version β the function that sets the HTTP request protocol version. literally just that. one job. she ate. π
π¦ SYNOPSIS π¦
#include <nng/nng.h>
#include <nng/supplemental/http/http.h>
int nng_http_req_set_version(nng_http_req *req, const char *version);
β¨ DESCRIPTION β¨
so, nng_http_req_set_version() sets the HTTP protocol version that's associated with the request req, and it sets it to version. that's the whole vibe.
the version you pass in must be a string containing a valid HTTP protocol version β think something like "HTTP/1.0". and the default value? it's "HTTP/1.1". so if you never touch it, that's what you get. π«Ά
also important: a local copy of the version is made inside the request req. so it's not just pointing at your string, it's holding its own little copy. main character energy, honestly β she doesn't share. π
Note β bestie, please hear me: no validation of the version supplied is performed. like... none. zero. she trusts you completely. π so type carefully.
Note β plot twist: the library does not contain support for versions of HTTP other than"HTTP/1.0"and"HTTP/1.1". if you specify any other version, you may get unspecified behavior. so like... don't? unless you enjoy chaos. π
π RETURN VALUES π
this function returns 0 on success, and non-zero otherwise. classic. no notes. β¨
π₯ ERRORS π₯
NNG_ENOMEMβ insufficient memory to perform the operation. the girl is tired, she needs RAM. πNNG_ENOTSUPβ no support for HTTP in the library. possible, but like... rude? π
π SEE ALSO π
and that's the whole page, bestie β go forth and set those versions responsibly π¦π
sign-off time: this was NNG_HTTP_...T_VERSION(3http) from the NNG Reference Manual, dated 2026-01-13 β mwah, ily, bye! πππΈ
π¦ 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