mirror of
https://github.com/tenrok/axios.git
synced 2026-06-14 18:42:33 +03:00
This reverts commit 73e3bdb883.
This commit is contained in:
+1
-11
@@ -3,7 +3,6 @@
|
||||
var utils = require('./utils');
|
||||
var normalizeHeaderName = require('./helpers/normalizeHeaderName');
|
||||
var enhanceError = require('./core/enhanceError');
|
||||
var toFormData = require('./helpers/toFormData');
|
||||
|
||||
var DEFAULT_CONTENT_TYPE = {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
@@ -72,17 +71,10 @@ var defaults = {
|
||||
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
|
||||
return data.toString();
|
||||
}
|
||||
|
||||
var isObjectPayload = utils.isObject(data);
|
||||
var contentType = headers && headers['Content-Type'];
|
||||
|
||||
if ( isObjectPayload && contentType === 'multipart/form-data' ) {
|
||||
return toFormData(data, new (this.env && this.env.FormData || FormData));
|
||||
} else if ( isObjectPayload || contentType === 'application/json' ) {
|
||||
if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {
|
||||
setContentTypeIfUnset(headers, 'application/json');
|
||||
return stringifySafely(data);
|
||||
}
|
||||
|
||||
return data;
|
||||
}],
|
||||
|
||||
@@ -120,8 +112,6 @@ var defaults = {
|
||||
maxContentLength: -1,
|
||||
maxBodyLength: -1,
|
||||
|
||||
env: {},
|
||||
|
||||
validateStatus: function validateStatus(status) {
|
||||
return status >= 200 && status < 300;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user