servo/components/script/dom/webidls/Headers.webidl
Malisa Smith e631d3a5f6 Headers API constructor and methods
- Reworked the append method to support the inner `hyper::header::Headers`'s HashMap `insert` method, which overwrites entries instead of appending.
- Filled out constructor as well as delete, get, has, and set methods.
- Updated relevant test expectations
2016-07-30 10:32:51 -07:00

24 lines
775 B
Text

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// https://fetch.spec.whatwg.org/#headers-class
// TODO support OpenEndedDictionary<ByteString>
typedef (Headers or sequence<sequence<ByteString>>) HeadersInit;
[Constructor(optional HeadersInit init),
Exposed=(Window,Worker)]
interface Headers {
[Throws]
void append(ByteString name, ByteString value);
[Throws]
void delete(ByteString name);
[Throws]
ByteString? get(ByteString name);
[Throws]
boolean has(ByteString name);
[Throws]
void set(ByteString name, ByteString value);
// iterable<ByteString, ByteString>; // TODO see issue #12628
};