michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIInputStream; michael@0: michael@0: [scriptable, uuid(AD9D3F1C-A8DE-4d0b-9714-1B922297AD65)] michael@0: interface nsIUploadChannel2 : nsISupports michael@0: { michael@0: /** michael@0: * Sets a stream to be uploaded by this channel with the specified michael@0: * Content-Type and Content-Length header values. michael@0: * michael@0: * Most implementations of this interface require that the stream: michael@0: * (1) implement threadsafe addRef and release michael@0: * (2) implement nsIInputStream::readSegments michael@0: * (3) implement nsISeekableStream::seek michael@0: * michael@0: * @param aStream michael@0: * The stream to be uploaded by this channel. michael@0: * @param aContentType michael@0: * This value will replace any existing Content-Type michael@0: * header on the HTTP request, regardless of whether michael@0: * or not its empty. michael@0: * @param aContentLength michael@0: * A value of -1 indicates that the length of the stream should be michael@0: * determined by calling the stream's |available| method. michael@0: * @param aMethod michael@0: * The HTTP request method to set on the stream. michael@0: * @param aStreamHasHeaders michael@0: * True if the stream already contains headers for the HTTP request. michael@0: */ michael@0: void explicitSetUploadStream(in nsIInputStream aStream, michael@0: in ACString aContentType, michael@0: in long long aContentLength, michael@0: in ACString aMethod, michael@0: in boolean aStreamHasHeaders); michael@0: michael@0: /** michael@0: * Value of aStreamHasHeaders from the last successful call to michael@0: * explicitSetUploadStream. TRUE indicates the attached upload stream michael@0: * contians request headers. michael@0: */ michael@0: readonly attribute boolean uploadStreamHasHeaders; michael@0: };