1 .\" cgiSetHeader - Specify an additional HTTP header
2 .\" Copyright (c) 1999,2008 by Martin Schulze <joey@infodrom.org>
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.
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.
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.
18 .TH cgiSetHeader 3 "6 April 2008" "CGI Library" "Programmer's Manual"
20 cgiSetHeader \- Specify an additional HTTP header
25 .BI "int cgiSetHeader (char *" name ", char *" value );
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.
36 This routine will only add the header to the internal stack, not print
37 it. They will be printed by
40 This routine does some syntax checking before accepting a new header.
43 of a header must not contain any newline, space or colon, otherwise it
44 will be truncated. The
46 must not contain any newline, otherwise it will be truncated as well.
48 To set a cookie in your program you'll need to manually add additional
49 header lines. Please take a look at
51 Basically, you'll need to add the following code:
54 cgiSetHeader ("Set-Cookie", "Version=1; name=value; Path=/");
58 Please read the included file
63 On success 1 is returned, otherwise 0.
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.
72 .BR cgiGetCookies (3),