ns_returnadminnotice status msg ?longmsg?
ns_returnfile status type filename
ns_returnfp status type fileId len
ns_returnnotice status msg ?longmsg?
These procedures provide a simple interface for returning information to the client. They build HTTP/1.0 headers and send the appropriate data out the socket.
type should be a MIME type (see ns_guesstype manual page for a list).
status is a three-digit number fitting the pattern below:
Some common status values and their meanings are:
ns_return sends back both the headers and the string.
ns_returnadminnotice performs the same function as ns_returnnotice, except that it appends a line with a link to "mailto:serveradministrator" based on the virtual server parameter "WebMaster".
ns_returnbadrequest returns a 400 status code and a formatted HTML message containing the reason text.
ns_returnerror wraps the text msg in some html and returns that to the client.
ns_returnfile sends back the headers and the contents of the file.
ns_returnforbidden returns a 403 status code.
ns_returnfp first sends the appropriate headers. Next, it writes out the contents of file from the current file position until the end of the file.
ns_returnnotfound returns a 404 status code.
ns_returnnotice wraps the text msg and longmsg in some html and returns that to the client.
ns_returnredirect returns a redirect to the passed in location.
ns_returnunauthorized returns a 401 status code.
ns_conn outputheaders, ns_write (Tcl API)
Ns_ReturnHtml(), Ns_ReturnFile(), Ns_ReturnOpenFile(), Ns_ReturnError(), Ns_DbReturnError(), Ns_ReturnStatus(), Ns_ReturnNotice(), Ns_ReturnOk(), Ns_ReturnNoResponse(), Ns_ReturnRedirect(), Ns_ReturnNotModified(), Ns_ReturnBadRequest(), Ns_ReturnUnauthorized(), Ns_ReturnForbidden(), Ns_ReturnNotFound(), Ns_ReturnNotImplemented() (C API)