mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
Supporting a fetch like API
This commit is contained in:
+4
-4
@@ -6,11 +6,11 @@ var dispatchRequest = require('./core/dispatchRequest');
|
||||
var InterceptorManager = require('./core/InterceptorManager');
|
||||
|
||||
var axios = module.exports = function (config) {
|
||||
// Allow for axios('example/url')
|
||||
// Allow for axios('example/url'[, config]) a la fetch API
|
||||
if (typeof config === 'string') {
|
||||
config = {
|
||||
url: config
|
||||
};
|
||||
config = utils.merge({
|
||||
url: arguments[0]
|
||||
}, arguments[1]);
|
||||
}
|
||||
|
||||
config = utils.merge({
|
||||
|
||||
Reference in New Issue
Block a user