Name
FormData — an HTTP multipart/form-data request body
Synopsis
The FormData type is a feature of XMLHttpRequest Level 2 (XHR2) that makes it easy to perform HTTP PUT requests with multipart/form-data encoding using an XMLHttpRequest. Multipart encoding is necessary, for example, if you want to upload multiple File objects in a single request.
Create a FormData object with the constructor, and then add
name/value pairs to it with the append()
method. Once you have added all
of the parts of your request body, you can pass the FormData to the
send()
method of an
XMLHttpRequest.
Constructor
new
FormData
()
This no-argument constructor returns an empty FormData object.
Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.