W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2014

RE: Fetch API

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Fri, 6 Jun 2014 07:33:42 +0000
To: Anne van Kesteren <annevk@annevk.nl>
CC: public-script-coord <public-script-coord@w3.org>, Joshua Bell <jsbell@chromium.org>, Jungkee Song <jungkee.song@samsung.com>, Yehuda Katz <wycats@gmail.com>, Alex Russell <slightlyoff@google.com>, Jonas Sicking <jonas@sicking.cc>, Jake Archibald <jaffathecake@gmail.com>, Tobie Langel <tobie.langel@gmail.com>, WebApps WG <public-webapps@w3.org>
Message-ID: <46e917d316b14e0b906b54ae80b00ce8@BN1PR05MB325.namprd05.prod.outlook.com>
It seems to me that for both the HeaderMap constructor and any object-literal processing, the best solution for now is to just do things in prose...

-----Original Message-----
From: annevankesteren@gmail.com [mailto:annevankesteren@gmail.com] On Behalf Of Anne van Kesteren
Sent: Wednesday, June 4, 2014 00:50
To: Domenic Denicola
Cc: public-script-coord; Joshua Bell; Jungkee Song; Yehuda Katz; Alex Russell; Jonas Sicking; Jake Archibald; Tobie Langel; WebApps WG
Subject: Re: Fetch API

On Sun, Jun 1, 2014 at 8:06 AM, Domenic Denicola <domenic@domenicdenicola.com> wrote:
> - HeaderMap should have a constructor that takes an iterable of [key, value] pairs, in the same way Map does.

Yeah, waiting for IDL hooks that would work here ;-)


> - I like HeaderMap a lot, but for construction purposes, I wonder if a 
> shorthand for the usual case could be provided. E.g. it would be nice 
> to be able to do
>
> fetch("http://example.com", {
>   headers: {
>     "X-Foo": "Bar"
>   }
> });
>
> instead of, assuming a constructor is added,
>
> fetch("http://example.com", {
>   headers: new HeaderMap([
>     ["X-Foo", "Bar"]
>   ])
> });

Yeah, it's not clear to me what is best here. An object whose keys are ByteString and values are either ByteString or a sequence of ByteString? I agree that we want this. Part of the problem here is how to best represent HTTP headers. See
https://github.com/slightlyoff/ServiceWorker/issues/300 for more details.


--
http://annevankesteren.nl/

Received on Friday, 6 June 2014 07:34:44 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:21 UTC