GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  KHTTP_HEAD (3)

NAME

khttp_head - emit HTTP headers for kcgi

CONTENTS

Library
Synopsis
Description
Examples
See Also
Authors
Caveats

LIBRARY


.Lb libkcgi

SYNOPSIS


.In stdint.h
.In kcgi.h void
.Fo khttp_head struct kreq *req const char *key const char *fmt ...
.Fc

DESCRIPTION

The khttp_head function emits HTTP headers for a kcgi(3) context allocated by khttp_parse(3). This may only be invoked prior to khttp_body(3); if not, its behaviour is undefined. The key value should be an HTTP response pair key. The fmt string and variable arguments, which follow printf(3) syntax, should be the HTTP response pair value.

The kresps global array, defined in khttp_parse(3), provides indexed HTTP response keys for the default
.Vt enum kresp . Use it!

See khttp_body(3) for a discussion on the "Content-Encoding" header: do not specify this header before doing so!

EXAMPLES

To emit a session cookie (no expiration date) with key "foo" and value "bar" for the global path, one may invoke the following. Assume that r is a context allocated by khttp_parse(3).
khttp_head(r, kresps[KRESP_SET_COOKIE], "%s", "foo=bar; path=/");

SEE ALSO

kcgi(3), khttp_body(3), khttp_parse(3)

AUTHORS

The khttp_head function was written by
.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .

CAVEATS

Long header values (>= 1024 B) will be truncated.
Search for    or go to Top of page |  Section 3 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.