mirror of
https://github.com/tenrok/axios.git
synced 2026-06-11 18:02:32 +03:00
Added enhanced toFormData implementation with additional options support; (#4704)
Updated default notation for arrays and objects to bracket style; Added `multer/express.js` tests; Updated README.md; Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
@@ -77,7 +77,11 @@ var defaults = {
|
||||
|
||||
if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {
|
||||
var _FormData = this.env && this.env.FormData;
|
||||
return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());
|
||||
return toFormData(
|
||||
isFileList ? {'files[]': data} : data,
|
||||
_FormData && new _FormData(),
|
||||
this.formSerializer
|
||||
);
|
||||
} else if (isObjectPayload || contentType === 'application/json') {
|
||||
setContentTypeIfUnset(headers, 'application/json');
|
||||
return stringifySafely(data);
|
||||
|
||||
Reference in New Issue
Block a user