This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2021.
Note: This feature is available in Web Workers.
The formData() method of the Response interface takes a Response stream and reads it to completion. It returns a promise that resolves with a FormData object.
Note: This is mainly relevant to service workers. If a user submits a form and a service worker intercepts the request, you could for example call formData() on it to obtain a key-value map, modify some fields, then send the form onwards to the server (or use it locally).
formData()
None.
A Promise that resolves with a FormData object.
AbortError DOMException
The request was aborted.
TypeErrorThrown for one of the following reasons:
Content-Encoding header is incorrect).Content-Type headers included in the response.FormData object.TBD.
| Specification |
|---|
| Fetch> # ref-for-dom-body-formdata①> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
formData |
60 | 79 | 39 | 47 | 14.1 | 60 | 39 | 44 | 14.5 | 8.0 | 60 | 14.5 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Response/formData