[whatwg/fetch] Provide more ergonomic way of setting request URL's query (#799)

I stumbled across https://github.com/github/fetch/issues/256 today and it seems there's quite a bit of demand for a more ergonomic way of setting URL's query.

This would add some API surface, but otherwise be explained in terms of existing primitives. I'd expect we'd reuse the constructor argument from https://url.spec.whatwg.org/#interface-urlsearchparams (presumably abstract that with a typedef) and name the dictionary member `urlSearch` or `urlSearchParams`.

There's another question of what to do when the URL already has query parameters. Replacing would be somewhat more trivial to define I expect, but appending is probably what should happen.

cc @theefer @mislav

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/799

Received on Tuesday, 21 August 2018 08:35:28 UTC