Untypo
[infodrom/cgilib] / cgiSetHeader.3
1 .\" cgiSetHeader - Specify an additional HTTP header
2 .\" Copyright (c) 1999,2008 by Martin Schulze <joey@infodrom.org>
3 .\" 
4 .\" This program is free software; you can redistribute it and/or modify
5 .\" it under the terms of the GNU General Public License as published by
6 .\" the Free Software Foundation; either version 2 of the License, or
7 .\" (at your option) any later version.
8 .\" 
9 .\" This program is distributed in the hope that it will be useful,
10 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 .\" GNU General Public License for more details.
13 .\" 
14 .\" You should have received a copy of the GNU General Public License
15 .\" along with this program; if not, write to the Free Software Foundation
16 .\" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 .\"
18 .TH cgiSetHeader 3 "6 April 2008" "CGI Library" "Programmer's Manual"
19 .SH NAME
20 cgiSetHeader \- Specify an additional HTTP header
21 .SH SYNOPSYS
22 .nf
23 .B #include <cgi.h>
24 .sp
25 .BI "int cgiSetHeader (char *" name ", char *" value );
26 .fi
27 .SH DESCRIPTION
28 With the
29 .B cgiSetHeader
30 routine you may specify additional HTTP header lines such as Expires:
31 or Pragma:.  The order of header lines withing the HTTP header has no
32 significance.  You may call this routine multiple times to set
33 multiple headers.  They will be printed in the same order as
34 specified, however, after the Content-type: header.
35
36 This routine will only add the header to the internal stack, not print
37 it.  They will be printed by
38 .BR cgiHeader (3).
39
40 This routine does some syntax checking before accepting a new header.
41 The
42 .I name
43 of a header must not contain any newline, space or colon, otherwise it
44 will be truncated.  The
45 .I value
46 must not contain any newline, otherwise it will be truncated as well.
47
48 To set a cookie in your program you'll need to manually add additional
49 header lines.  Please take a look at
50 .IR cgitest.c .
51 Basically, you'll need to add the following code:
52
53 .nf
54    cgiSetHeader ("Set-Cookie", "Version=1; name=value; Path=/");
55    cgiHeader();
56 .fi
57
58 Please read the included file
59 .I cookies.txt
60 as well.
61
62 .SH "RETURN VALUE"
63 On success 1 is returned, otherwise 0.
64
65 .SH "AUTHOR"
66 This CGI library is written by Martin Schulze
67 <joey@infodrom.org>.  If you have additions or improvements
68 please get in touch with him.
69
70 .SH "SEE ALSO"
71 .BR cgiHeader (3),
72 .BR cgiGetCookies (3),
73 .BR cgiGetCookie (3),
74 .BR cgiInit (3).