files/en-us/web/api/response/formdata/index.md
{{APIRef("Fetch API")}}{{AvailableInWorkers}}
The formData() method of the {{domxref("Response")}} interface
takes a {{domxref("Response")}} stream and reads it to completion. It returns a promise
that resolves with a {{domxref("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 {{jsxref("Promise")}} that resolves with a {{domxref("FormData")}} object.
AbortError {{domxref("DOMException")}}
application/x-www-form-urlencoded or multipart/form-data.FormData object.TBD.
{{Specifications}}
{{Compat}}