Difference between revisions of "Ns respond"

From AOLserver Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
What does it do, nobody knows?
+
ns_respond
 +
Overview
 +
 
 +
Build a complete response
 +
Syntax
 +
 
 +
ns_respond ?-status status? ?-type type?
 +
 
 +
{?-string string? | ?-file file? | ?-fileid fileid? }
 +
 
 +
?-length length? ?-headers setId?
 +
Description
 +
 
 +
ns_respond builds a complete response for the client with all of the specified information in the header.
 +
Example
 +
 
 +
Using ns_respond, it's easy to do an HTTP redirect:
 +
 
 +
    set headers [ns_set new myheaders]
 +
    ns_set put $headers location http://www.aolserver.com
 +
    ns_respond -status 302 -type text/plain \
 +
    -string "redirection" -headers $headers

Revision as of 16:05, 18 February 2006

ns_respond Overview

Build a complete response Syntax

ns_respond ?-status status? ?-type type?

{?-string string? | ?-file file? | ?-fileid fileid? }

?-length length? ?-headers setId? Description

ns_respond builds a complete response for the client with all of the specified information in the header. Example

Using ns_respond, it's easy to do an HTTP redirect:

   set headers [ns_set new myheaders]
   ns_set put $headers location http://www.aolserver.com
   ns_respond -status 302 -type text/plain \
   	-string "redirection" -headers $headers