How does axios determin the url? #5567
-
Hi! So just (I hope) a quick question since we are having an internal discussion about this but how does axios determine which url it should use? We have a call that does this
and then a reverse proxy in our nginx configuration to route it correctly. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So since axios becomes Request sent from https://axios-http.com/docs/intro with the path Any request made with Request sent from https://axios-http.com/docs/intro with the path |
Beta Was this translation helpful? Give feedback.
So since axios becomes
XMLHttpRequests
on the client machine it uses the default behavior of javascript which makes all requests starting with/api
start at the base address of the homepage e.gRequest sent from https://axios-http.com/docs/intro with the path
/api/test
is transformed tohttps://axios-http.com/api/test
Any request made with
api/
uses the current homepage address path execept current page e.gRequest sent from https://axios-http.com/docs/intro with the path
api/test
is transformed tohttps://axios-http.com/docs/api/test