W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2014

Re: [whatwg] Fetch: asFormData()

From: Anne van Kesteren <annevk@annevk.nl>
Date: Wed, 25 Jun 2014 17:34:53 +0200
Message-ID: <CADnb78hpYdVuRy0itMhMCY4fw3Z=46reO-jS2YudKWVayxbZig@mail.gmail.com>
To: Domenic Denicola <domenic@domenicdenicola.com>
Cc: WHATWG <whatwg@whatwg.org>, Jake Archibald <jaffathecake@gmail.com>
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.

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

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:21 UTC