NE_REDIRECT_REGISTER(3)
π NAME π
okay bestie, this page is all about ne_redirect_register and ne_redirect_location β aka HTTP request redirect handling, from the neon API reference, page NE_REDIRECT_REGISTER(3). π
β¨ SYNOPSIS β¨
#include <ne_redirect.h>
void ne_redirect_register(ne_session *sess);
const ne_uri *ne_redirect_location(ne_session *sess);
π¦ DESCRIPTION π¦
So ne_redirect_register does exactly what it says on the tin: it registers redirect handling for the session. β¨ If a valid redirect response gets processed β and yes, that means one with a status code 3xx β the request will fail with the NE_REDIRECT error code. Not a vibe, but very intentional. π Then you can grab the destination of the redirect using ne_redirect_location.
And if a redirect was processed, ne_redirect_location returns the destination URI of the redirect. Slay. π«Ά
πΈ RETURN VALUE πΈ
ne_redirect_location returns NULL if:
- no request has yet been processed,
- the current request was not a redirect, or
- the destination of the redirect could not be parsed or resolved.
Otherwise? It returns a pointer to an ne_uri object. That pointer stays valid until another request is created for the session. periodt. π
π SEE ALSO π
π COPYRIGHT π
Copyright Β© 2001-2026 Joe Orton
neon Β· 03/20/2026 β mwah, thatβs the source/version and date, bestie, and this page is officially done. π§π
π¦ where this page comes from
- arch rolling: neon 0.37.1-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms