Debian Codegraph @

deps/libneon/doc/man/ne_get_response_header.3

raw
1 '\" t
2 .\" Title: ne_get_response_header
3 .\" Author:
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
5 .\" Date: 3 May 2011
6 .\" Manual: neon API reference
7 .\" Source: neon 0.29.6
8 .\" Language: English
9 .\"
10 .TH "NE_GET_RESPONSE_HEAD" "3" "3 May 2011" "neon 0.29.6" "neon API reference"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 ne_get_response_header, ne_response_header_iterate \- functions to access response headers
32 .SH "SYNOPSIS"
33 .sp
34 .ft B
35 .nf
36 #include <ne_request\&.h>
37 .fi
38 .ft
39 .HP \w'const\ char\ *ne_get_response_header('u
40 .BI "const char *ne_get_response_header(ne_request\ *" "request" ", const\ char\ *" "name" ");"
41 .HP \w'void\ *ne_response_header_iterate('u
42 .BI "void *ne_response_header_iterate(ne_request\ *" "request" ", void\ *" "cursor" ", const\ char\ **" "name" ", const\ char\ **" "value" ");"
43 .SH "DESCRIPTION"
44 .PP
45 To retrieve the value of a response header field, the
46 \fBne_get_response_header\fR
47 function can be used, and is given the name of the header to return\&.
48 .PP
49 To iterate over all the response headers returned, the
50 \fBne_response_header_iterate\fR
51 function can be used\&. This function takes a
52 \fIcursor\fR
53 parameter which should be
54 NULL
55 to retrieve the first header\&. The function stores the name and value of the next header header in the
56 \fIname\fR
57 and
58 \fIvalue\fR
59 parameters, and returns a new cursor pointer which can be passed to
60 \fBne_response_header_iterate\fR
61 to retrieve the next header\&.
62 .SH "RETURN VALUE"
63 .PP
64 \fBne_get_response_header\fR
65 returns a string, or
66 NULL
67 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
68 \fBne_begin_request\fR, or else, until the request object is destroyed\&.
69 .PP
70 Likewise, the cursor, names, and values returned by
71 \fBne_response_header_iterate\fR
72 are only valid until the next call to
73 \fBne_begin_request\fR
74 or until the request object is destroyed\&.
75 .SH "EXAMPLES"
76 .PP
77 The following code will output the value of the
78 Last\-Modified
79 header for a resource:
80 .sp
81 .if n \{\
82 .RS 4
83 .\}
84 .nf
85 ne_request *req = ne_request_create(sess, "GET", "/foo\&.txt");
86 if (ne_request_dispatch(req) == NE_OK) {
87 const char *mtime = ne_get_response_header(req, "Last\-Modified");
88 if (mtime) {
89 printf("/foo\&.txt has last\-modified value %s\en", mtime);
90 }
91 }
92 ne_request_destroy(req);
93 .fi
94 .if n \{\
95 .RE
96 .\}
97 .SH "SEE ALSO"
98 .PP
99 ne_request_create,
100 ne_request_destroy\&.
101 .SH "AUTHOR"
102 .PP
103 \fBJoe Orton\fR <\&[email protected]\&>
104 .RS 4
105 Author.
106 .RE
107 .SH "COPYRIGHT"
108 .br