我如何发送一个axios请求到正确的url?
我正在尝试从我的android离子React应用程序发出GET请求:
axios.get("192.168.178.88:8080/api/user/me")
.then(response =>response.data)
我未从端点获得预期结果,并获得以下日志
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
我希望并期望请求
http://192.168.178.88:8080/api/user/me
代替
本地192.168.178.88:8080/api/user/me
1条答案
按热度按时间vjrehmav1#
不要忘记将
http
添加到axios请求中的URL: