PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, October 14, 2022

[FIXED] How to send request to remote URLs?

 October 14, 2022     android, axios, ionic-framework, reactjs     No comments   

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

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

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
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing