gecko-dev/netwerk/protocol/http/public/nsIHttpChannel.idl

103 lines
3.5 KiB
Plaintext
Raw Normal View History

/* -*- 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;
interface nsISimpleEnumerator;
[scriptable, uuid(d78b53c8-d03f-4fd8-b2ee-7b36fcd150d1)]
interface nsIHttpChannel : nsIChannel
{
/**************************************************************************
* Request info...
*/
/**
* The request method is case insensitive
*/
attribute ACString requestMethod;
/**
* 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
* section 14.36).
*/
attribute nsIURI referrer;
/**
* Header strings are case insensitive. Setting a header is additive; to
* clear a header, assign an empty string.
*/
ACString getRequestHeader(in ACString header);
void setRequestHeader(in ACString header, in ACString value);
void visitRequestHeaders(in nsIHttpHeaderVisitor visitor);
/**************************************************************************
* Response info...
*/
readonly attribute unsigned long responseStatus;
readonly attribute ACString responseStatusText;
readonly attribute boolean requestSucceeded;
/**
* Header strings are case insensitive. Setting a header is additive; to
* clear a header, assign an empty string.
*/
ACString getResponseHeader(in ACString header);
void setResponseHeader(in ACString header, in ACString value);
void visitResponseHeaders(in nsIHttpHeaderVisitor visitor);
/**
* 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();
/**
* 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;
/**
* 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;
};