HTTPResponseCode
HTTP Bridge Response Code
Index > Books > Declarative Development Guide > Reference Library > Accessor Listing > HTTPResponseCode

Rate this page:
Really useful
Satisfactory
Not helpful
Confusing
Incorrect
Unsure
Extra comments:


Module

urn:org:ten60:netkernel:tpt:http

Definition

Active URI Base

active:HTTPResponseCode

Format

<instr>
  <type>HTTPResponseCode</type>
  <operand>this:response</operand>
  <param>
    <HTTPResponseCode>
      <code>303</code>
      <header>
        <name>Location</name>
        <value>http://www.1060.org/</value>
      </header>
    </HTTPResponseCode>
  </param>
  <target>this:response</target>
</instr>

Syntax

ArgumentRulesDescription
typeMandatory HTTPResponseCode
operandMandatory an optional resource to attach the response code to
paramMandatory the response code document
targetMandatory this:response

The HTTPResponseCode accessor creates an HTTP Response code. If an operand is supplied the response code is attached to the operand resource and returned as a multipart. If no operand is supplied then the response code aspect is returned on its own.

The HTTP Bridge detects a resource with an HTTPResponseCode aspect and sets the HTTP Response response code and any specified HTTP headers on the HTTP response stream. If HTTP Bridge detects the HTTPResponseCode in conjunction with a multipart the companion part will be written to the body of the HTTP response stream - in this way detailed response messages can be returned to the client.

Response Code Document

A response code is supplied as an XML document in the param argument. The document has the following form

<HTTPResponseCode>
  <code>303</code>
  <reason>Redirected by the application</reason>
  <header>
    <name>Location</name>
    <value>http://www.1060.org/</value>
  </header> ...
</HTTPResponseCode>

Any number of header sections may be provided. The name field should be an appropriate HTTP/1.0 header name.

© 2003-2005, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.