2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-05 16:42:32 +03:00

Fixing axios to treat single string argument as URL

closes #116
This commit is contained in:
mzabriskie
2015-09-28 18:40:20 -06:00
parent eca2ac88eb
commit 95f0f00c77
2 changed files with 20 additions and 0 deletions
+7
View File
@@ -6,6 +6,13 @@ var dispatchRequest = require('./core/dispatchRequest');
var InterceptorManager = require('./core/InterceptorManager');
var axios = module.exports = function (config) {
// Allow for axios('example/url')
if (typeof config === 'string') {
config = {
url: config
};
}
config = utils.merge({
method: 'get',
headers: {},