neon API reference NEGETRESPONSEH(3)
NAME
negetresponseheader, neresponseheaderiterate - func-
tions to access response headers
SYNOPSIS
#include
const char *negetresponseheader (nerequest *request,
const char *name);
void *neresponseheaderiterate (nerequest *request,
void *cursor,
const char **name,
const char **value);
DESCRIPTION
To retrieve the value of a response header field, the
negetresponseheader function can be used, and is given
the name of the header to return.
To iterate over all the response headers returned, the
neresponseheaderiterate function can be used. This func-
tion takes a cursor parameter which should be NUL to re-
trieve the first header. The function stores the name and
value of the next header header in the name and value param-
eters, and returns a new cursor pointer which can be passed
to neresponseheaderiterate to retrieve the next header.
RETURN VALUE
negetresponseheader returns a string, or NUL if no
header with that name was given. If used during request pro-
cessing, the return value pointer is valid only until the
next call to nebeginrequest, or else, until the request
object is destroyed.
Likewise, the cursor, names, and values returned by
neresponseheaderiterate are only valid until the next
call to nebeginrequest or until the request object is des-
troyed.
EXAMPLES
The following code will output the value of the
Last-Modified header for a resource:
nerequest *req = nerequestcreate(sess, "GET", "/foo.txt");
if (nerequestdispatch(req) == NEOK) {
neon 0.25.5 Last change: 20 January 2006 1
neon API reference NEGETRESPONSEH(3)
const char *mtime = negetresponseheader(req, "Last-Modified");
if (mtime) {
printf("/foo.txt has last-modified value %s\n", mtime);
}
}
nerequestdestroy(req);
SEE ALSO
nerequestcreate(3), nerequestdestroy(3).
AUTHOR
Joe Orton .
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
box; cbp-1 cbp-1 l l . ATRIBUTE TYPE ATRIBUTE VALUE =
Availability SUNWneon = Interface Stability Volatile
NOTES
Source for Neon is available on http:/opensolaris.org.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Availability SUNWneon
Interface Stability Volatile
NOTES
Source for Neon is available on http:/opensolaris.org.
neon 0.25.5 Last change: 20 January 2006 2
|