Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not sure if it's a bug!url in instance.create, url not in instance.request,it not work #4650

Open
ctforcp opened this issue Apr 28, 2022 · 2 comments
Labels
state::triage Issue that is awaiting trial

Comments

@ctforcp
Copy link

ctforcp commented Apr 28, 2022

Describe the bug

put url in axios.create config,and instance.request config not hava url,not work

To Reproduce

https://runkit.com/fsafsfsdfsd/626a182eb041210008b9e157

var axios = require("axios")

function requestBase(method,url,config){
    const instance = axios.create({
        baseURL: 'https://626a153e737b438c1c41c57d.mockapi.io',
        method,

        url,// [url] put here not work
    });

    //url in axios.create , request config is undefined , there is no url,not work
    instance.request(config).then(response=>{
        console.log('response: ',response.data);
    }).catch(error=>{
        console.log('error: ',error);
    });
}

//not work,put url in axios.create
requestBase('get','/users');

//it work
requestBase('get','','/users');
requestBase('get','',{url:'/users'});

Environment

  • Axios Version [ 0.27.2 ]

@productdevbook
Copy link

some problem

@TheRealMadMesi
Copy link

Same problem

@jasonsaayman jasonsaayman added the state::triage Issue that is awaiting trial label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state::triage Issue that is awaiting trial
Projects
None yet
Development

No branches or pull requests

4 participants