mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
Clean up PR
This commit is contained in:
+3
-7
@@ -23,21 +23,17 @@ function Axios(instanceConfig) {
|
||||
* @param {Object} config The config specific for this request (merged with this.defaults)
|
||||
*/
|
||||
Axios.prototype.request = function request(config) {
|
||||
config = config || {};
|
||||
|
||||
/*eslint no-param-reassign:0*/
|
||||
// Allow for axios('example/url'[, config]) a la fetch API
|
||||
if (typeof config === 'string') {
|
||||
config = arguments[1] || {};
|
||||
config.url = arguments[0];
|
||||
}
|
||||
|
||||
if (!config.method) {
|
||||
config.method = 'get';
|
||||
} else {
|
||||
config = config || {};
|
||||
}
|
||||
|
||||
config = utils.mergeConfig(this.defaults, config);
|
||||
config.method = config.method.toLowerCase();
|
||||
config.method = config.method ? config.method.toLowerCase() : 'get';
|
||||
|
||||
// Hook up interceptors middleware
|
||||
var chain = [dispatchRequest, undefined];
|
||||
|
||||
Reference in New Issue
Block a user