May 2011
Intermediate to advanced
1093 pages
40h 54m
English
Content preview from JavaScript: The Definitive Guide, 6th EditionBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
Start your free trial


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
newFormData()
This no-argument constructor returns an empty FormData object.