From 6566598603953b159ec23227e100c7013c39efea Mon Sep 17 00:00:00 2001 From: ahmed ayoub Date: Tue, 10 Oct 2017 21:17:37 +0200 Subject: [PATCH] allowing default method for an instance --- lib/core/Axios.js | 2 +- lib/defaults.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core/Axios.js b/lib/core/Axios.js index f1af3e7bf6..f6eca9251b 100644 --- a/lib/core/Axios.js +++ b/lib/core/Axios.js @@ -32,7 +32,7 @@ Axios.prototype.request = function request(config) { }, arguments[1]); } - config = utils.merge(defaults, this.defaults, { method: 'get' }, config); + config = utils.merge(defaults, this.defaults, config); config.method = config.method.toLowerCase(); // Hook up interceptors middleware diff --git a/lib/defaults.js b/lib/defaults.js index 9587b28b68..2142bdb252 100644 --- a/lib/defaults.js +++ b/lib/defaults.js @@ -26,6 +26,7 @@ function getDefaultAdapter() { } var defaults = { + method: 'get', adapter: getDefaultAdapter(), transformRequest: [function transformRequest(data, headers) {