0

I'm using xamarin forms + asp.net core web api. If I try to call from Postmat then everything is fine, but if I call from a device (I use a real device, not an emulator) then I have this error "Failed to connect to localhost / 127.0.0.1: 44373" My string "https: // localhost: 44373 / api / v1 / reports / get_reports" Phone local IP - 192.168.0.101

My ipconfig Wireless LAN adapter Wi-Fi:

Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::4dbf:c945:4125:74c8%5 IPv4 Address. . . . . . . . . . . : 192.168.0.102 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.0.1

Espi4U
  • 7
  • 2
  • do not use localhost, use the real IP or FQDN of the server. Localhost is the address a machine uses to connect TO ITSELF – Jason Apr 14 '20 at 19:44
  • now i have this - failed to connect to /000.00.000.000 (port 44373) from /192.168.0.101 (port 48471 – Espi4U Apr 14 '20 at 20:18
  • if you are using the VS web server, it is not configured to allow remote connections by default. – Jason Apr 14 '20 at 20:22
  • Tack a look at: https://stackoverflow.com/questions/4779963/how-can-i-access-my-localhost-from-my-android-device – Hamid Reza Mohammadi Apr 14 '20 at 20:28

0 Answers0