netwerk/base/public/nsIUploadChannel2.idl

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:77c93c0cee65
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #include "nsISupports.idl"
7
8 interface nsIInputStream;
9
10 [scriptable, uuid(AD9D3F1C-A8DE-4d0b-9714-1B922297AD65)]
11 interface nsIUploadChannel2 : nsISupports
12 {
13 /**
14 * Sets a stream to be uploaded by this channel with the specified
15 * Content-Type and Content-Length header values.
16 *
17 * Most implementations of this interface require that the stream:
18 * (1) implement threadsafe addRef and release
19 * (2) implement nsIInputStream::readSegments
20 * (3) implement nsISeekableStream::seek
21 *
22 * @param aStream
23 * The stream to be uploaded by this channel.
24 * @param aContentType
25 * This value will replace any existing Content-Type
26 * header on the HTTP request, regardless of whether
27 * or not its empty.
28 * @param aContentLength
29 * A value of -1 indicates that the length of the stream should be
30 * determined by calling the stream's |available| method.
31 * @param aMethod
32 * The HTTP request method to set on the stream.
33 * @param aStreamHasHeaders
34 * True if the stream already contains headers for the HTTP request.
35 */
36 void explicitSetUploadStream(in nsIInputStream aStream,
37 in ACString aContentType,
38 in long long aContentLength,
39 in ACString aMethod,
40 in boolean aStreamHasHeaders);
41
42 /**
43 * Value of aStreamHasHeaders from the last successful call to
44 * explicitSetUploadStream. TRUE indicates the attached upload stream
45 * contians request headers.
46 */
47 readonly attribute boolean uploadStreamHasHeaders;
48 };

mercurial