Songbird / Development / Songbird Add-Ons API Documentation

nsIHttpResponse Interface Reference

An interface that represents an HTTP response, as described in RFC 2616, section 6. More...

import "nsIHttpServer.idl";

List of all members.

Public Member Functions

void setStatusLine (in string httpVersion, in unsigned short statusCode, in string description)
void setHeader (in string name, in string value, in boolean merge)
void write (in string data)

Public Attributes

readonly attribute nsIOutputStream bodyOutputStream


Detailed Description

An interface that represents an HTTP response, as described in RFC 2616, section 6.

Definition at line 295 of file nsIHttpServer.idl.


Member Function Documentation

void nsIHttpResponse::setStatusLine ( in string  httpVersion,
in unsigned short  statusCode,
in string  description 
)

Sets the status line for this. If this method is never called on this, the status line defaults to "HTTP/", followed by the server's default HTTP version (e.g. "1.1"), followed by " 200 OK".

Parameters:
httpVersion the HTTP version of this, as a string (e.g. "1.1"); if null, the server default is used
code the numeric HTTP status code for this
description a human-readable description of code; may be null if no description is desired
Exceptions:
NS_ERROR_INVALID_ARG if httpVersion is not a valid HTTP version string, statusCode is greater than 999, or description contains invalid characters

void nsIHttpResponse::setHeader ( in string  name,
in string  value,
in boolean  merge 
)

Sets the specified header in this.

Parameters:
name the name of the header; must match the field-name production per RFC 2616
value the value of the header; must match the field-value production per RFC 2616
merge when true, if the given header already exists in this, the values passed to this function will be merged into the existing header, per RFC 2616 header semantics; when false, if the given header already exists in this, it is overwritten with the passed-in values; if the header doesn't exist in this, it is set regardless of the value of this parameter
Exceptions:
NS_ERROR_INVALID_ARG if name or value is not a valid header component

void nsIHttpResponse::write ( in string  data  ) 

Write a string to the response's output stream.

Note:
This method is only guaranteed to work with ASCII data.


Member Data Documentation

readonly attribute nsIOutputStream nsIHttpResponse::bodyOutputStream

A stream to which data appearing in the body of this response should be written.

Definition at line 341 of file nsIHttpServer.idl.


The documentation for this interface was generated from the following file:
Generated on Tue Mar 10 14:28:56 2009 for Songbird by  doxygen 1.5.2