files/en-us/web/api/formdata/index.md
{{APIRef("XMLHttpRequest API")}} {{AvailableInWorkers}}
The FormData interface provides a way to construct a set of key/value pairs representing form fields and their values, which can be sent using the {{domxref("Window/fetch", "fetch()")}}, {{domxref("XMLHttpRequest.send()")}} or {{domxref("navigator.sendBeacon()")}} methods. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
You can also pass it directly to the {{domxref("URLSearchParams")}} constructor if you want to generate query parameters in the way a {{HTMLElement("form")}} would do if it were using simple GET submission.
An object implementing FormData can directly be used in a {{jsxref("Statements/for...of", "for...of")}} structure, instead of {{domxref('FormData.entries()', 'entries()')}}: for (const p of myFormData) is equivalent to for (const p of myFormData.entries()).
FormData object.FormData object, or adds the key if it does not already exist.FormData object.FormData.FormData object.FormData.FormData object contains a certain key.FormData.FormData object, or adds the key/value if it does not already exist.FormData.{{Specifications}}
{{Compat}}