Answer the question
In order to leave comments, you need to log in
Why does the browser make a request for a url without a domain when requesting a url without an explicit domain?
I'm making an app with laravel + Vuejs. For ajax-a I use Axios.
Everywhere for axios I specify the address from the root, for example axios.get('/v1/users'). Logically, the browser should make a request relative to the current domain, but it makes a request to this address: http:// v1/users . This doesn't happen all the time, but once in a while. I can't even imagine what it could be. Any ideas?
Answer the question
In order to leave comments, you need to log in
https://github.com/axios/axios#global-axios-defaults
axios.defaults.baseURL = 'https://api.example.com';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question