NE_GET_STATUS(3)
π NE_GET_STATUS(3) β neon API reference, bestie β¨
Okay so welcome to NE_GET_STATUS(3), the neon API reference page thatβs literally here to help you retrieve HTTP response properties. Pull up a chair, bestie, weβre getting into it. π
β¨ NAME β¨
ne_get_status, ne_get_response_location, ne_get_response_retry_after β retrieve HTTP response properties. Thatβs the whole assignment, and it ate. π
πΈ SYNOPSIS πΈ
#include <ne_request.h>
const ne_status *ne_get_status(const ne_request *request);
ne_uri *ne_get_response_location(ne_request *request);
time_t ne_get_response_retry_after(ne_request *request);
π DESCRIPTION π
Okay so ne_get_status returns a pointer to the HTTP status object that gives the result of a request. Lowkey important: the object returned only becomes valid once the request has been successfully dispatched β and by βsuccessfullyβ we mean the return value of ne_request_dispatch or ne_begin_request was zero. Periodt. β¨
If the response includes a Location header, ne_get_response_location parses and resolves the URI-reference relative to the request target. If a fragment ("#fragment") is applicable to the request target, it can be passed as an argument to allow appropriate relative resolution. Cute, right? π
ne_get_response_retry_after parses any Retry-After header included in the response. If the header value uses a relative time, it is interpreted relative to the time the function was invoked, rather than the time the response was received β so the function should be used directly after dispatching the request. Not me warning you about timing, but yes, timing matters bestie. π
π«Ά RETURN VALUE π«Ά
ne_get_statusβ returns a pointer to the HTTP status object giving the result of a request. This pointer is valid until the associated request object is destroyed. Slay, but donβt hold it past its lifespan. πne_get_response_locationβ returns amalloc-allocatedne_uriobject, orNULLif either the URI in theLocationheader could not be parsed or theLocationheader was not present. π¦ne_get_response_retry_afterβ returns atime_tvalue, or zero if either noRetry-Afterheader was included or the header value could not be parsed. π₯
π EXAMPLES π
Display the response status code of applying the HEAD method to some resource. Main character example incoming: π
ne_request *req = ne_request_create(sess, "HEAD", "/foo/bar");
if (ne_request_dispatch(req))
/* handle errors... */
else
printf("Response status code was %d\n", ne_get_status(req)->code);
ne_request_destroy(req);
β HISTORY β
ne_get_response_location is available in neon 0.34.0 and later. Not ancient, but iconic. π
π SEE ALSO π
π COPYRIGHT π
Copyright Β© 2001-2026 Joe Orton
Signed off with love: source/version neon, date 03/20/2026 β mwah ππ
π¦ 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