mirror of
https://github.com/tenrok/axios.git
synced 2026-06-23 20:40:40 +03:00
allowing default method for an instance
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ Axios.prototype.request = function request(config) {
|
|||||||
}, arguments[1]);
|
}, arguments[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
config = utils.merge(defaults, this.defaults, { method: 'get' }, config);
|
config = utils.merge(defaults, this.defaults, config);
|
||||||
config.method = config.method.toLowerCase();
|
config.method = config.method.toLowerCase();
|
||||||
|
|
||||||
// Hook up interceptors middleware
|
// Hook up interceptors middleware
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ function getDefaultAdapter() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var defaults = {
|
var defaults = {
|
||||||
|
method: 'get',
|
||||||
adapter: getDefaultAdapter(),
|
adapter: getDefaultAdapter(),
|
||||||
|
|
||||||
transformRequest: [function transformRequest(data, headers) {
|
transformRequest: [function transformRequest(data, headers) {
|
||||||
|
|||||||
Reference in New Issue
Block a user