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 Β© 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