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).
Syntax
Parameters
Return value
A Promise
that resolves with a FormData
object.
Examples
Specifications
Browser compatibility
|
Desktop |
Mobile |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
WebView Android |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
formData |
60 |
79 |
39 |
No |
47 |
14.1
10.1The method exists but always rejects with NotSupportedError . See bug 215671.
|
60 |
60 |
39 |
44 |
14.5
10.3The method exists but always rejects with NotSupportedError . See bug 215671.
|
8.0 |
See also