We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
axios
Learn more about funding links in repositories.
Report abuse
1 parent 55e6577 commit cd1b82bCopy full SHA for cd1b82b
lib/core/Axios.js
@@ -26,14 +26,14 @@ function Axios(instanceConfig) {
26
*
27
* @param {Object} config The config specific for this request (merged with this.defaults)
28
*/
29
-Axios.prototype.request = function request(config) {
+Axios.prototype.request = function request(configOrUrl, config) {
30
/*eslint no-param-reassign:0*/
31
// Allow for axios('example/url'[, config]) a la fetch API
32
- if (typeof config === 'string') {
33
- config = arguments[1] || {};
34
- config.url = arguments[0];
35
- } else {
+ if (typeof configOrUrl === 'string') {
36
config = config || {};
+ config.url = configOrUrl;
+ } else {
+ config = configOrUrl || {};
37
}
38
39
config = mergeConfig(this.defaults, config);
0 commit comments