Re: [whatwg] Fetch: asFormData()

On Wed, Jun 25, 2014 at 5:31 PM, Domenic Denicola
<domenic@domenicdenicola.com> wrote:
> What about asURLSearchParams()? It seems qualitatively different, because if a form sends form data in a body, then parsing it as form data makes sense. But asURLSearchParams() seems like it is instead parsing a form-data body as a query string representation, which was not its original format. Servers manipulate query strings all the time too, but they usually don't manipulate request bodies as if they were query strings.

I think you are confused. <form method=POST> will by default use the
format associated with URLSearchParams. However, per option 1) we can
also parse this format and spit out a FormData, making
asURLSearchParams() redundant and probably unneeded.

If you have <form method=GET> you would not invoke this method on the
body (there is no body, doh). You'd simply use
request.url.searchParams which is fully synchronous to boot.


-- 
http://annevankesteren.nl/

Received on Wednesday, 25 June 2014 15:35:19 UTC