Headers.webidl (1223B)
1 /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 * 7 * The origin of this IDL file is 8 * http://fetch.spec.whatwg.org/#headers-class 9 */ 10 11 typedef (sequence<sequence<ByteString>> or record<ByteString, ByteString>) HeadersInit; 12 13 enum HeadersGuardEnum { 14 "none", 15 "request", 16 "request-no-cors", 17 "response", 18 "immutable" 19 }; 20 21 [Exposed=(Window,Worker)] 22 interface Headers { 23 [Throws] 24 constructor(optional HeadersInit init); 25 26 [Throws] undefined append(ByteString name, ByteString value); 27 [Throws] undefined delete(ByteString name); 28 [Throws] ByteString? get(ByteString name); 29 sequence<ByteString> getSetCookie(); 30 [Throws] boolean has(ByteString name); 31 [Throws] undefined set(ByteString name, ByteString value); 32 iterable<ByteString, ByteString>; 33 34 // Used to test different guard states from mochitest. 35 // Note: Must be set prior to populating headers or will throw. 36 [ChromeOnly, SetterThrows] attribute HeadersGuardEnum guard; 37 };