WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIHttpRequestMetadata

IID:3a899b17-b6eb-4333-8ef4-912df454a551
Inherits From:nsIPropertyBag

Properties

readonly nsISimpleEnumerator headers

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 char* 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.

readonly char* 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 char* method

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

readonly char* path

The requested path, without any query string (e.g. "/dir/file.txt"). It is guaranteed to begin with a "/". This string is in the

readonly PRUint32 port

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

readonly char* queryString

The URL-encoded query string associated with this request, not including the initial "?".


Methods

char* getHeader ( char* fieldName ) PRBool hasHeader ( char* fieldName )

char* getHeader ( char* fieldName )

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

Arguments:
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

PRBool hasHeader ( char* fieldName )

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

Arguments:
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

References

This interface is passed as an argument to the following methods:

nsIHttpRequestHandler.handle

Reference documentation is generated from Mozilla's source.

Copyright © 1999-2006 XULPlanet.com