<html>
<head>
<title>Responses</title>
<meta name="keywords" content="">
</head>

<body bgcolor=#113377 text=#000000 vlink=#551a8b alink=#00c0ff link=#0000ee>




















































<table width=100% border=0>
<tr>
  <td valign=top>
  <table width=100% cellpadding=5 cellspacing=0 border=0>
    <tr><td bgcolor="#ffffff" align=center>
       <img alt="" border=0 height=40 src="../../img/logga.gif" width=102>
    </td></tr>
    <tr><td valign=top>
      <img src=internal-roxen-unit width=1 height=3 alt="">
    </td></tr>
    <tr valign=top>
      <td bgcolor="#ffffff">




        <table cellpadding=0 cellspacing=0 border=0>
          
       <!--a1  Introduction manual.tmpl-->
    
            <tr><td><a href="../introduction/index.html"><img border=0 src="../../img/chapter.gif"></a>&nbsp;</td>
	      <td><a href="../introduction/index.html">Introduction</a></td>
	    </tr>
    
          
       <!--a1  CGI and SSI manual.tmpl-->
    
            <tr><td><a href="../cgi/index.html"><img border=0 src="../../img/chapter.gif"></a>&nbsp;</td>
	      <td><a href="../cgi/index.html">CGI and SSI</a></td>
	    </tr>
    
          
       <!--a1  &lt;pike&gt; tag manual.tmpl-->
    
            <tr><td><a href="../pike-tag/index.html"><img border=0 src="../../img/chapter.gif"></a>&nbsp;</td>
	      <td><a href="../pike-tag/index.html">&lt;pike&gt; tag</a></td>
	    </tr>
    
          
       <!--a1  Pike script manual.tmpl-->
    
            <tr><td><a href="../pike-scripts/index.html"><img border=0 src="../../img/chapter.gif"></a>&nbsp;</td>
	      <td><a href="../pike-scripts/index.html">Pike script</a></td>
	    </tr>
    
          
       <!--a1  Modules manual.tmpl-->
    
            <tr><td><a href="../modules/index.html"><img border=0 src="../../img/chapter.gif"></a>&nbsp;</td>
	      <td><a href="../modules/index.html">Modules</a></td>
	    </tr>
    
          
       <!--a1  Parser modules manual.tmpl-->
    
            <tr><td><a href="../tag-modules/index.html"><img border=0 src="../../img/chapter.gif"></a>&nbsp;</td>
	      <td><a href="../tag-modules/index.html">Parser modules</a></td>
	    </tr>
    
          
       <!--a1  Location modules manual.tmpl-->
    
            <tr><td><a href="../location-modules/index.html"><img border=0 src="../../img/chapter.gif"></a>&nbsp;</td>
	      <td><a href="../location-modules/index.html">Location modules</a></td>
	    </tr>
    
          
       <!--a1  Other module types manual.tmpl-->
    
            <tr><td><a href="../other-modules/index.html"><img border=0 src="../../img/chapter.gif"></a>&nbsp;</td>
	      <td><a href="../other-modules/index.html">Other module types</a></td>
	    </tr>
    
          
       <!--a1  Request information object manual.tmpl-->
    
            <tr><td><a href="../id/index.html"><img border=0 src="../../img/chapter.gif"></a>&nbsp;</td>
	      <td><a href="../id/index.html">Request information object</a></td>
	    </tr>
    
          
       <!--a1  Responses manual.tmpl-->
    
            <tr><td><a href="index.html"><img border=0 src="../../img/chapter.gif"></a>&nbsp;</td>
	      <td><a href="index.html"><b>Responses</b></a></td>
	    </tr>
    
          
	</table>
	
        <table cellpadding=0 cellspacing=0 border=0>
	  
        </table>

        <table cellpadding=0 cellspacing=0 border=0>
          
      <!--c1  -->
    
            <tr><td><a href="../library-methods/index.html"><img border=0 src="../../img/chapter.gif"></a>&nbsp;</td>
	      <td><a href="../library-methods/index.html">Library methods</a></td>
	    </tr>
    
          
	</table>

      </td>
    </tr>
    <tr><td height=100%>&nbsp;</td></tr>
  </table>
  </td>
  <td>
    <img src=internal-roxen-unit width=3 height=1 alt="">
  </td>

  <td valign=top>
    <table cellspacing=0 cellpadding=5 width=100% height=100% border=0>
    <tr>
      <td bgcolor="#ffffff">
       <b><font size=+2>Responses</font></b>

	<p>Many API methods have a common set of responses, that are:

<dl>
<dt><b>zero</b><dd>



means that the module could not handle the request.

<p>
<dt><b>minus one</b><dd>



means that the requested object was a directory. The request will be
sent to a directory module, if present.

<p>
<dt><b>Stdio.File</b><dd>



the file object will be sent to the browser, after the <i>Content
types</i> module has determined the appropriate content type.

<p>
<dt><b>response mapping</b><dd>



contains all information necessary for Challenger to send the result
to the browser. It includes header information as well as file
content. The response mapping should not be created by hand but rather
by an appropriate response method.
</dl>

The response methods are available if <i>roxenlib</i> has been
inherited. They are:

<dl>

<dt><b>http_string_answer( string contents, void|string type )</b><dd>



simply returns the <i>contents</i> as the content type <i>type</i>, or
by default <tt>text/html</tt>.

<p>
<dt><b>http_rxml_answer( string rxml, object id,
void|object(Stdio.File) file, string|void type )</b><dd>



returns <i>rxml</i> after sending it through the RXML parser, as
<tt>text/html</tt> unless the <i>type</i> argument is given.

<p>
<dt><b>http_file_answer( Stdio.File file, void|string type, void|string
len)</b><dd>



returns the contents of <i>file</i> which should be open for reading. 

<p>
<dt><b>http_auth_required( string realm, string message )</b><dd>



is used to prompt the user to log on. A web browser will open
a dialog prompting the user to fill in her user name and password. The
<i>realm</i> argument is a string which will be used to distinguish
different protected domains on the same server from each other. The
<i>message</i> argument will be shown if the user decides not to try
to log on.

<p>
<dt><b>http_redirect( string url, void|object id )</b><dd>



creates a redirect response that will make the web browser try to
fetch the redirected page. <i>id</i> is only required if the URL is a
relative URL, that is, one that doesn't specify a protocol and server,
in which case the <tt>http_redirect()</tt> will need more data
to create a complete URL.

<p>
<dt><b>http_pipe_in_progress()</b><dd>



tells Challenger that your module will take charge of delivering data
to the user. Challenger will ignore the request from now on
and let the module handle the file object associated with the
request. The file object is found in the <tt>my_fd</tt> field of the
id object.
</dl>


      </td>
    </tr>
    </table>
  </td>
</tr>
<tr>
</table>
</body>
</html>
