- From: Luis Canales <notifications@github.com>
- Date: Sun, 29 May 2016 19:28:34 -0700
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc:
Received on Monday, 30 May 2016 02:29:02 UTC
@annevk, the URL objects do not have that `.searchParams` property. These are the fixes it requires:
```js
function urlWithParams(urlString, params={}) {
var url = new URL(urlString);
var searchParams = new URLSearchParams();
Object.keys(params).forEach((key) => {
searchParams.append(key, params[key]);
});
url.search = searchParams.toString();
return url.toString();
}
```
Object.keys will return an array and the values will be lost in the foreach callback.
---
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/56#issuecomment-222400044
Received on Monday, 30 May 2016 02:29:02 UTC