From bd729221699337a6557b42e99374ed79b96ac099 Mon Sep 17 00:00:00 2001 From: joe Date: Wed, 14 Sep 2005 21:11:32 +0000 Subject: * doc/ref/resphdr.xml: New file; document response header handling. * doc/manual.xml: Reference it. git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@698 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845 --- doc/manual.xml | 6 ++-- doc/ref/resphdr.xml | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 doc/ref/resphdr.xml (limited to 'doc') diff --git a/doc/manual.xml b/doc/manual.xml index f78de1b..d3880b6 100644 --- a/doc/manual.xml +++ b/doc/manual.xml @@ -52,6 +52,7 @@ + @@ -144,7 +145,6 @@ ignoring the WebDAV support if desired. &refneon; &refconfig; - &refreqhdr; &refresolve; &refbuf; &refbufapp; @@ -155,8 +155,10 @@ ignoring the WebDAV support if desired. &refgetst; &refiaddr; &refalloc; - &refreq; &refsess; + &refreq; + &refreqhdr; + &refresphdr; &refopts; &refreqopts; &refreqbody; diff --git a/doc/ref/resphdr.xml b/doc/ref/resphdr.xml new file mode 100644 index 0000000..af9546f --- /dev/null +++ b/doc/ref/resphdr.xml @@ -0,0 +1,98 @@ + + + + ne_get_response_header + 3 + + + + ne_get_response_header + ne_response_header_iterate + functions to access response headers + + + + + + + #include <ne_request.h> + + + const char *ne_get_response_header + ne_request *request + const char *name + + + + void *ne_response_header_iterate + ne_request *request + void *cursor + const char **name + const char **value + + + + + + + + Description + + To retrieve the value of a response header field, the + ne_get_response_header function can be used, + and is given the name of the header to return. + + To iterate over all the response headers returned, the + ne_response_header_iterate function can be + used. This function takes a cursor + parameter which should be &null; to retrieve the first header. The + function stores the name and value of the next header header in + the name and value + parameters, and returns a new cursor pointer which can be passed + to ne_response_header_iterate to retrieve the + next header. + + + + + Return value + + ne_get_response_header returns a + string, or &null; if no header with that name was given. If used + during request processing, the return value pointer is valid only + until the next call to ne_begin_request, or + else, until the request object is destroyed. + + Likewise, the cursor, names, and values returned by + ne_response_header_iterate are only valid + until the next call to ne_begin_request or + until the request object is destroyed. + + + + + Examples + + The following code will output the value of the + Last-Modified header for a resource: + + ne_request *req = ne_request_create(sess, "GET", "/foo.txt"); +if (ne_request_dispatch(req) == NE_OK) { + const char *mtime = ne_get_response_header(req, "Last-Modified"); + if (mtime) { + printf("/foo.txt has last-modified value %s\n", mtime); + } +} +ne_request_destroy(req); + + + + + See also + + , . + + + + -- cgit v1.2.1