new_http_response

NAME
SYNOPSIS
DESCRIPTION
AUTHOR
LICENSE
VERSION
SEE ALSO

NAME

new_http_response, http_response_send_header, http_response_send_headers, http_response_end_headers - functions for sending HTTP responses

SYNOPSIS

#include <pthr_http.h>

http_response new_http_response (pseudothread, http_request, io_handle, int code, const char *msg);
void http_response_send_header (http_response, const char *key, const char *value);
void http_response_send_headers (http_response, ...);
int http_response_end_headers (http_response h);

DESCRIPTION

These functions allow you to efficiently generate outgoing HTTP responses.
new_http_response generates a new HTTP response object and returns it. code is the HTTP response code (see RFC 2616 for a list of codes), and msg is the HTTP response message.
http_response_send_header sends a single HTTP header back to the client. The header is constructed by concatenating key, ": ", value and CR LF.
http_response_send_headers sends back several headers in a single call. The arguments to this function are a list of key, value pairs followed by a single NULL argument which terminates the list.
http_response_end_headers ends the header list. It causes the code to emit any missing-but-required headers and then send the final CR LF characters.

AUTHOR

Richard Jones <rich@annexia.org>

LICENSE

GNU LGPL (see http://www.gnu.org/)

VERSION

pthrlib-3.0.3

SEE ALSO

new_http_request(3), new_cgi(3), new_pseudothread(3), io_fdopen(3), RFC 2616.