W3cubDocs

/Web APIs

Response: formData() method

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

js

formData()

Parameters

None.

Return value

A Promise that resolves with a FormData object.

Examples

TBD.

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

© 2005–2023 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