khttp_head man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

KHTTP_HEAD(3)		 BSD Library Functions Manual		 KHTTP_HEAD(3)

NAME
     khttp_head — emit HTTP headers for kcgi

LIBRARY
     library “libkcgi”

SYNOPSIS
     #include <stdint.h>
     #include <kcgi.h>

     void
     khttp_head(struct kreq *req, const char *key, const char *fmt, ...);

DESCRIPTION
     The khttp_head function emits HTTP headers for a kcgi(3) context allo‐
     cated 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 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 Kristaps Dzonsons
     ⟨kristaps@bsd.lv⟩.

CAVEATS
     Long header values (≥ 1024 B) will be truncated.

BSD				April 29, 2024				   BSD
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net