axios.getUri doesn't use baseURL
See original GitHub issueDescribe the bug When using https://github.com/axios/axios/pull/1712 example and adding baseURL in config, baseURL seems to not be used.
To Reproduce
const axios = require("axios");
const fakeConfig = {
method: "post",
url: "/user/12345",
baseURL: "/foo"
};
console.log(axios.getUri(fakeConfig));
Expected behavior
axios.getUri
should return /foo/user/12345
.
If this expected behavior seems right, I can work on a fix.
Environment:
- Axios Version: 0.19.0
- OS: Linux, Windows
- Browser Chrome but also happen on Firefox and node
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Check Axios request url before sending - Stack Overflow
I am within the Expo , React Native environment. Working example using fetch: const url = `https://maps.googleapis.com/maps/api/geocode/json ...
Read more >Request Config | Axios Docs
It can be convenient to set `baseURL` for an instance of axios to pass relative URLs // to methods of that instance. baseURL:...
Read more >Use your own base url - orval.dev
Use your own base url. orval doesn't set any base url by default but you have multiple possibility to add it. Axios. You...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
PR #2555 was never merged so this should still be open. The solution looks valid though, so I guess a new PR could be opened. I will try to do that later.
URI may be only
/user/12345
if you want to to identify the request locally to a endpoint. If you want to identifiy the request globally the endpoint URI should be including IHMO. URI specification shows examples including the protocole and the domain name https://tools.ietf.org/html/rfc3986. I think thatgetUri
should include as many things as possible to identify the request.