NNG_HTTP_...T_VERSION(3http)

πŸ“¦ version 1.11, in alpine 3.24

πŸ’… 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