Stefan Bollmann
Stefan Bollmann

Reputation: 720

How to send request to remote URLs?

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

http://192.168.178.88:8080/api/user/me

instead of

http://localhost/192.168.178.88:8080/api/user/me

Upvotes: 1

Views: 349

Answers (1)

Stefan Bollmann
Stefan Bollmann

Reputation: 720

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)

Upvotes: 1

Related Questions