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

RE: Fetch API

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Sun, 1 Jun 2014 06:06:54 +0000
To: Anne van Kesteren <annevk@annevk.nl>, 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>
CC: WebApps WG <public-webapps@w3.org>
Message-ID: <ff9e25777ed7470a851b0b2d764e9f04@BN1PR05MB325.namprd05.prod.outlook.com>
Overall it looks really solid. Only a few things I could think of:

- Named constructors scare me (I can't figure out how to make them work in JavaScript without breaking at least one of the normal invariants). I think a static factory method would make more sense for RedirectResponse.

- HeaderMap should have a constructor that takes an iterable of [key, value] pairs, in the same way Map does.

- 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"]

-----Original Message-----
From: annevankesteren@gmail.com [mailto:annevankesteren@gmail.com] On Behalf Of Anne van Kesteren
Sent: Thursday, May 29, 2014 08:57
To: public-script-coord; Joshua Bell; Jungkee Song; Yehuda Katz; Alex Russell; Jonas Sicking; Jake Archibald; Tobie Langel
Cc: WebApps WG
Subject: Fetch API

The plan is to implement and ship this fairly soon, so I figured I'd ask for review now, while we're still drafting the text:


In particular I'd like feedback on the design of Request and Response classes, and the fetch() method.


Received on Sunday, 1 June 2014 06:07:28 UTC

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