You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
whatwg-fetch,isomorphic-fetch: BodyInit should accept ArrayBuffer #9378
body: Any body that you want to add to your request: this can be a Blob, ArrayBuffer, FormData, URLSearchParams, or USVString object. Note that a request using the GET or HEAD method cannot have a body.
changed the title [-]whatwg-fetch,isomorphic-fetch: BodyInit should accept arrayBuffer[/-][+]whatwg-fetch,isomorphic-fetch: BodyInit should accept ArrayBuffer[/+]on May 17, 2016
Thanks for this, I've added BodyInit to the list of supported types. I'm pretty sure we should have URLSearchParams in there too, but not sure if this is part of any TypeScript definition yet.
@shaunluttin Does it make sense for this to be part of the fetch typings or more general browser typings? I'm not sure myself. It is documented in the fetch spec, so maybe.
I don't see that node-fetch supports it (the other half of the isomorphic-fetch implementation). It could be added for the browser half (whatwg-fetch), but users would need to be aware of the context that they're using it in.
I'd be happy to add it if it makes sense. I've just been following what the whatwg-fetch folks have been doing (with consideration given for node-fetch concerns). Which implementation are you using? Does it conform to the interface documented in the fetch spec?
@saschanaz, @ryan-codingintrigue Do you have thoughts about where URISearchParams should live? Seems like it might better fit in a browser API typing. But if it's not anywhere, yet, maybe we add it to whatwg-fetch and isomorphic-fetch. What do you think?
URLSearchParams is not defined within the Fetch standard, it is part of the URL Standard, but Fetch is the only specification to actually use the interface right now.
Activity
[-]whatwg-fetch,isomorphic-fetch: BodyInit should accept arrayBuffer[/-][+]whatwg-fetch,isomorphic-fetch: BodyInit should accept ArrayBuffer[/+]ryan-codingintrigue commentedon May 18, 2016
Thanks for this, I've added
BodyInitto the list of supported types. I'm pretty sure we should have URLSearchParams in there too, but not sure if this is part of any TypeScript definition yet.shaunluttin commentedon Oct 9, 2016
The lack of
URLSearchParamsis a major pain point.toddlucas commentedon Oct 10, 2016
@shaunluttin Does it make sense for this to be part of the fetch typings or more general browser typings? I'm not sure myself. It is documented in the fetch spec, so maybe.
I don't see that node-fetch supports it (the other half of the isomorphic-fetch implementation). It could be added for the browser half (whatwg-fetch), but users would need to be aware of the context that they're using it in.
I'd be happy to add it if it makes sense. I've just been following what the whatwg-fetch folks have been doing (with consideration given for node-fetch concerns). Which implementation are you using? Does it conform to the interface documented in the fetch spec?
shaunluttin commentedon Oct 10, 2016
I don't know.
The pain comes when using it with the
aurelia-fetch-client. Maybe there is a way to rely on its types instead.I don't know that answer to that either.
toddlucas commentedon Oct 10, 2016
@saschanaz, @ryan-codingintrigue Do you have thoughts about where URISearchParams should live? Seems like it might better fit in a browser API typing. But if it's not anywhere, yet, maybe we add it to whatwg-fetch and isomorphic-fetch. What do you think?
saschanaz commentedon Oct 11, 2016
I think we should add a new URLSearchParams definition file and then add a reference on this fetch definition.
ryan-codingintrigue commentedon Oct 11, 2016
URLSearchParamsis not defined within the Fetch standard, it is part of the URL Standard, but Fetch is the only specification to actually use the interface right now.AFAIK, global definitions like this should be in TypeScript's
lib.d.tsdefinition(See https://github.com/Microsoft/TypeScript/blob/master/src/lib/dom.generated.d.ts#L11759)
But they only go into that once Microsoft Edge supports the feature and at present, URLSearchParams is not present in Edge.
As for adding it, technically it's possible & I'm happy to do so, but I can't think of where it fits into the DefinitelyTyped structure. Maybe add typings for this polyfill: https://github.com/WebReflection/url-search-params?
saschanaz commentedon Oct 11, 2016
Then the right place to open a PR is here: https://github.com/Microsoft/TSJS-lib-generator