2001-05-11 21:04:09 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* The contents of this file are subject to the Mozilla Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code is Mozilla.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
|
|
|
* Communications. Portions created by Netscape Communications are
|
|
|
|
* Copyright (C) 2001 by Netscape Communications. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Gagan Saksena <gagan@netscape.com> (original author)
|
|
|
|
* Darin Fisher <darin@netscape.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsIChannel.idl"
|
|
|
|
|
|
|
|
interface nsIHttpHeaderVisitor;
|
2002-03-14 00:51:28 +00:00
|
|
|
interface nsISimpleEnumerator;
|
2001-05-11 21:04:09 +00:00
|
|
|
|
|
|
|
[scriptable, uuid(d78b53c8-d03f-4fd8-b2ee-7b36fcd150d1)]
|
|
|
|
interface nsIHttpChannel : nsIChannel
|
|
|
|
{
|
|
|
|
/**************************************************************************
|
|
|
|
* Request info...
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The request method is case insensitive
|
|
|
|
*/
|
2002-03-20 22:50:33 +00:00
|
|
|
attribute ACString requestMethod;
|
2001-05-11 21:04:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get/set the referrer URI on the request. This is the address (URI) of
|
|
|
|
* the resource from which this channel's URI was obtained (see RFC2616
|
2002-09-25 21:28:53 +00:00
|
|
|
* section 14.36).
|
2001-05-11 21:04:09 +00:00
|
|
|
*/
|
2002-09-25 21:28:53 +00:00
|
|
|
attribute nsIURI referrer;
|
2001-05-11 21:04:09 +00:00
|
|
|
|
|
|
|
/**
|
2002-09-27 04:22:13 +00:00
|
|
|
* Header strings are case insensitive. Setting a header is additive; to
|
|
|
|
* clear a header, assign an empty string.
|
2001-05-11 21:04:09 +00:00
|
|
|
*/
|
2002-03-20 22:50:33 +00:00
|
|
|
ACString getRequestHeader(in ACString header);
|
|
|
|
void setRequestHeader(in ACString header, in ACString value);
|
|
|
|
void visitRequestHeaders(in nsIHttpHeaderVisitor visitor);
|
2001-05-11 21:04:09 +00:00
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* Response info...
|
|
|
|
*/
|
|
|
|
|
|
|
|
readonly attribute unsigned long responseStatus;
|
2002-03-20 22:50:33 +00:00
|
|
|
readonly attribute ACString responseStatusText;
|
2002-07-01 23:12:13 +00:00
|
|
|
readonly attribute boolean requestSucceeded;
|
2001-05-11 21:04:09 +00:00
|
|
|
|
|
|
|
/**
|
2002-09-27 04:22:13 +00:00
|
|
|
* Header strings are case insensitive. Setting a header is additive; to
|
|
|
|
* clear a header, assign an empty string.
|
2001-05-11 21:04:09 +00:00
|
|
|
*/
|
2002-03-20 22:50:33 +00:00
|
|
|
ACString getResponseHeader(in ACString header);
|
|
|
|
void setResponseHeader(in ACString header, in ACString value);
|
|
|
|
void visitResponseHeaders(in nsIHttpHeaderVisitor visitor);
|
2001-05-11 21:04:09 +00:00
|
|
|
|
2002-01-09 04:18:48 +00:00
|
|
|
/**
|
|
|
|
* True if the server sent a "Cache-control: no-store" response header.
|
|
|
|
*/
|
|
|
|
boolean isNoStoreResponse();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* True if the server sent the equivalent of a "Cache-control: no-cache"
|
|
|
|
* response header. Other equivalent response headers include: "Pragma:
|
|
|
|
* no-cache" and "Expires" with a date-value in the past.
|
|
|
|
*/
|
|
|
|
boolean isNoCacheResponse();
|
|
|
|
|
2002-04-19 22:25:23 +00:00
|
|
|
/**
|
|
|
|
* This attribute is a hint to the channel to indicate whether or not
|
|
|
|
* the underlying HTTP transaction should be allowed to be pipelined
|
|
|
|
* with other transactions. This should be set to FALSE, for example,
|
|
|
|
* if the application knows that the corresponding document is likely
|
|
|
|
* to be very large.
|
|
|
|
*
|
|
|
|
* TRUE by default, though other factors may prevent pipelining.
|
|
|
|
*/
|
|
|
|
attribute boolean allowPipelining;
|
|
|
|
|
2001-12-08 00:23:04 +00:00
|
|
|
/**
|
|
|
|
* This attribute specifies the number of redirects this channel is allowed
|
|
|
|
* to make. If zero, the channel will fail to redirect and will generate
|
|
|
|
* a NS_ERROR_REDIRECT_LOOP failure status.
|
|
|
|
*/
|
|
|
|
attribute unsigned long redirectionLimit;
|
2001-05-11 21:04:09 +00:00
|
|
|
};
|