2👍
✅
Well, I run into the same issue and found that baseURL is case-sensitive.
Hence baseUrl
should be baseURL
and everything will work fine.
Here is axios
documentation for the creating instance.
const instance = axios.create({
baseURL: 'https://some-domain.com/api/',
timeout: 1000,
headers: {'X-Custom-Header': 'foobar'}
});
Here is working Codesandbox
Hope this helps!
1👍
good luck to find an answer.
But are you sure to use correctly axios ?
I see this.$http.post is for the normal request without axios and on npm VueAxios don’t use this.
I can recommend you this link
https://fr.vuejs.org/v2/cookbook/using-axios-to-consume-apis.html
Source:stackexchange.com