Add the option to use FormData to encode the form elements (#153)
* Add the option to use FormData to encode the form elements If the form's enctype attribute is set to "multipart/form-data", use FormData to encode the form's elements.
This commit was merged in pull request #153.
This commit is contained in:
@@ -6,6 +6,7 @@ module.exports = function(location, options, callback) {
|
||||
var requestOptions = options.requestOptions || {}
|
||||
var requestMethod = (requestOptions.requestMethod || "GET").toUpperCase()
|
||||
var requestParams = requestOptions.requestParams || null
|
||||
var formData = requestOptions.formData || null;
|
||||
var requestPayload = null
|
||||
var request = new XMLHttpRequest()
|
||||
var timeout = options.timeout || 0
|
||||
@@ -51,6 +52,9 @@ module.exports = function(location, options, callback) {
|
||||
break
|
||||
}
|
||||
}
|
||||
else if (formData) {
|
||||
requestPayload = formData
|
||||
}
|
||||
|
||||
// Add a timestamp as part of the query string if cache busting is enabled
|
||||
if (options.cacheBust) {
|
||||
|
||||
Reference in New Issue
Block a user