HTTPResponse

From Fernseher
Revision as of 18:02, 22 January 2009 by Admin (talk | contribs) (New page: This class represents HTTP Response messages for the Modjs environment. It contains information on the status line to be sent back in the response (or that was sent back in the respon...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

This class represents HTTP Response messages for the Modjs environment. It contains information on the status line to be sent back in the response (or that was sent back in the response), as well as the MIME entity that is the resultant response data and response headers, as a MimeEntity object. Primarily, this class represents a way for the Modjs script to return data to the requestor. To this end, there are many obStack related methods. These are only of use if this is _the_ response of the script. Otherwise, they don't really do much. They could, but they don't :) It can also be used to represent that data that is returned when manually requesting information from another HTTP server using a TCPConnection. In that case, the TCPConnection needs to be slurped up and passed to the HTTPResponse constructor.

To create an HTTPResponse object, the entire response text should be passed to the constructor, like so:

response = new HTTPResponse(response string)

Response objects will contain the following properties. They can be queried but usually should not be set directly, instead the obStack, print, setHeader, etc, methods should be used to ensure data consistency.

  • a
  • b

The methods on the object are:

c()
d()