Issue
How can I send an axios request to the right url?
I am trying to make a GET request from my android ionic react app:
axios.get("192.168.178.88:8080/api/user/me")
.then(response =>response.data)
I do not get the results expected from the endpoints and get the following logs
D/Capacitor: Handling local request: http://localhost/
I/Gralloc4: mapper 4.x is not supported
W/Gralloc3: mapper 3.x is not supported
D/Capacitor: Handling local request: http://localhost/static/js/main.c1f587ce.js
D/Capacitor: Handling local request: http://localhost/192.168.178.88:8080/api/user/me
I'd like and expect request to
instead of
http://localhost/192.168.178.88:8080/api/user/me
Solution
Do not forget to add http
to the URL in the axios request:
axios.get("http://192.168.178.88:8080/api/user/me")
.then(response =>response.data)
Answered By - Stefan Bollmann
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.