Ns headers

From AOLserver Wiki
Jump to: navigation, search

NAME

ns_headers - Write the HTTP-required and any queued http headers to the current connection's socket.

SYNOPSIS

ns_headers connId status ?type? ?length?

DESCRIPTION

This command writes immediately to the current connection's socket the standard HTTP response headers and any headers that have been queued with ns_conn outputheaders. No more headers can be sent after this and the body content can be sent with ns_write or ns_writefp.
Because this command allows for optional type and length parameters, the normally optional connId parameter is required (in AOLserver 4.5, connId is always available in the global variable conn (i.e. $::conn)).
See ns_return for details on the status and type parameters. length specifies what will be put into the Content-Length header. If type or length is omitted, the corresponding header (Content-Type and Content-Length) will not be sent. Content-Length is required to enable keep-alive.

NOTES

In NaviServer, this command doesn't immediately send the headers, it just queues them to be sent upon first ns_write.

SEE ALSO

ns_startcontent, ns_write, ns_return

Category Documentation - Category Core Tcl API