'\" t
.\" Title: ne_get_status
.\" Author:
.\" Generator: DocBook XSL Stylesheets vsnapshot
.\" Date: 04/17/2025
.\" Manual: neon API reference
.\" Source: neon
.\" Language: English
.\"
.TH "NE_GET_STATUS" "3" "04/17/2025" "neon" "neon API reference"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ne_get_status, ne_get_response_location \- retrieve HTTP response properties
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include
.fi
.ft
.HP \w'const\ ne_status\ *ne_get_status('u
.BI "const ne_status *ne_get_status(const\ ne_request\ *" "request" ");"
.HP \w'ne_uri\ *ne_get_response_location('u
.BI "ne_uri *ne_get_response_location(ne_request\ *" "request" ");"
.SH "DESCRIPTION"
.PP
The
\fBne_get_status\fR
function returns a pointer to the HTTP status object giving the result of a request\&. The object returned only becomes valid once the request has been
\fIsuccessfully\fR
dispatched (the return value of
\fBne_request_dispatch\fR
or
\fBne_begin_request\fR
was zero)\&.
.PP
If the response includes a
Location
header, the
\fBne_get_response_location\fR
function 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\&.
.SH "RETURN VALUE"
.PP
\fBne_get_status\fR
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\&.
.PP
\fBne_get_response_location\fR
returns a malloc\-allocated ne_uri object, or NULL if either the URI in the Location header could not be parsed or the Location header was not present\&.
.SH "EXAMPLES"
.PP
Display the response status code of applying the
HEAD
method to some resource\&.
.sp
.if n \{\
.RS 4
.\}
.nf
ne_request *req = ne_request_create(sess, "HEAD", "/foo/bar");
if (ne_request_dispatch(req))
/* handle errors\&.\&.\&. */
else
printf("Response status code was %d\en", ne_get_status(req)\->code);
ne_request_destroy(req);
.fi
.if n \{\
.RE
.\}
.SH "HISTORY"
.PP
\fBne_get_response_location\fR
is available in neon 0\&.34\&.0 and later\&.
.SH "SEE ALSO"
.PP
ne_status,
ne_request_create
.SH "COPYRIGHT"
.br
Copyright \(co 2001-2024 Joe Orton
.br