Public Member Functions | Public Attributes

nsIHttpRequest Interface Reference

A representation of the data included in an HTTP request. More...

import "nsIHttpServer.idl";

Collaboration diagram for nsIHttpRequest:

List of all members.

Public Member Functions

string getHeader (in string fieldName)
 Returns the value for the header in this request specified by fieldName.
boolean hasHeader (in string fieldName)
 Returns true if a header with the given field name exists in this, false otherwise.

Public Attributes

readonly attribute string method
 The request type for this request (see RFC 2616, section 5.1.1).
readonly attribute string scheme
 The scheme of the requested path, usually 'http' but might possibly be 'https' if some form of SSL tunneling is in use.
readonly attribute string host
 The host of the data being requested (e.g.
readonly attribute unsigned long port
 The port on the server on which the request was received.
readonly attribute string path
 The requested path, without any query string (e.g.
readonly attribute string queryString
 The URL-encoded query string associated with this request, not including the initial "?", or "" if no query string was present.
readonly attribute string httpVersion
 A string containing the HTTP version of the request (i.e., "1.1").
readonly attribute
nsISimpleEnumerator 
headers
 An nsISimpleEnumerator of nsISupportsStrings over the names of the headers in this request.
readonly attribute nsIInputStream bodyInputStream
 A stream from which data appearing in the body of this request can be read.

Detailed Description

A representation of the data included in an HTTP request.


Member Function Documentation

string nsIHttpRequest::getHeader ( in string  fieldName  ) 

Returns the value for the header in this request specified by fieldName.

Parameters:
fieldName the name of the field whose value is to be gotten; note that since HTTP header field names are case-insensitive, this method produces equivalent results for "HeAdER" and "hEADer" as fieldName
Returns:
The result is a string containing the individual values of the header, usually separated with a comma. The headers WWW-Authenticate, Proxy-Authenticate, and Set-Cookie violate the HTTP specification, however, and for these headers only the separator string is '
'.
Exceptions:
NS_ERROR_INVALID_ARG if fieldName does not constitute a valid header field name
NS_ERROR_NOT_AVAILABLE if the given header does not exist in this
boolean nsIHttpRequest::hasHeader ( in string  fieldName  ) 

Returns true if a header with the given field name exists in this, false otherwise.

Parameters:
fieldName the field name whose existence is to be determined in this; note that since HTTP header field names are case-insensitive, this method produces equivalent results for "HeAdER" and "hEADer" as fieldName
Exceptions:
NS_ERROR_INVALID_ARG if fieldName does not constitute a valid header field name

Member Data Documentation

A stream from which data appearing in the body of this request can be read.

An nsISimpleEnumerator of nsISupportsStrings over the names of the headers in this request.

The header field names in the enumerator may not necessarily have the same case as they do in the request itself.

readonly attribute string nsIHttpRequest::host

The host of the data being requested (e.g.

"localhost" for the http://localhost:8080/file resource). Note that the relevant port on the host is specified in this.port. This value is in the ASCII character encoding.

readonly attribute string nsIHttpRequest::httpVersion

A string containing the HTTP version of the request (i.e., "1.1").

Leading zeros for either component of the version will be omitted. (In other words, if the request contains the version "1.01", this attribute will be "1.1"; see RFC 2616, section 3.1.)

readonly attribute string nsIHttpRequest::method

The request type for this request (see RFC 2616, section 5.1.1).

readonly attribute string nsIHttpRequest::path

The requested path, without any query string (e.g.

"/dir/file.txt"). It is guaranteed to begin with a "/". The individual components in this string are URL-encoded.

readonly attribute unsigned long nsIHttpRequest::port

The port on the server on which the request was received.

readonly attribute string nsIHttpRequest::queryString

The URL-encoded query string associated with this request, not including the initial "?", or "" if no query string was present.

readonly attribute string nsIHttpRequest::scheme

The scheme of the requested path, usually 'http' but might possibly be 'https' if some form of SSL tunneling is in use.

Note that this value cannot be accurately determined unless the incoming request used the absolute-path form of the request line; it defaults to 'http', so only if it is something else can you be entirely certain it's correct.


The documentation for this interface was generated from the following file: