0

I'm trying to connect from my app that runs under android studio.

in the app i have base_url : http://192.168.10.224/xxxxx/public/

I connect in the browser of the virtual device and fins the page I want, so I know that the address is right.

I start the app and come to the loginpage.

I type my variables and press sign in.

And I get this in log:

2020-11-21 18:23:25.682 27502-27795/com.xxxxxx.user D/OkHttp: --> POST http://localhost/xxxxxx/public/api/user/oauth/token
2020-11-21 18:23:25.682 27502-27795/com.xxxxxx.user D/OkHttp: Content-Type: application/x-www-form-urlencoded
2020-11-21 18:23:25.704 27502-27795/com.xxxxxx.user D/OkHttp: <-- HTTP FAILED: java.net.ConnectException: Failed to connect to localhost/xxxxxx:80

Why can't I connect to localhost?

UPDATE: this is how I get in Android Studio

E/AAAA:  device token : 123456789
E/AAAA:  login: req: {"
password":"123456","
device_id":"123","
grant_type":"password","
device_token":"123456789","
device_type":"android","
client_secret":"111111111111","
client_id":"2","
username":"MYEMAIL"}
D/OkHttp: --> POST http://xxxxx/public/api/user/oauth/token
D/OkHttp: Content-Type: application/x-www-form-urlencoded
    Content-Length: 350
D/OkHttp: password=123456&device_id=123&grant_type=password&device_token=123456789&device_type=android&client_secret=111111111111&client_id=2&username=MYEMAIL
    --> END POST (350-byte body)
D/OkHttp: <-- 405 Method Not Allowed http://xxxxx/public/api/user/oauth/token (113ms)
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Niklas
  • 543
  • 2
  • 8
  • 17

0 Answers0