Я пытаюсь подключиться к localhost:3000/full
с помощью Retrofit на Android.
public class RestManager {
private QaraSozService qaraSozService;
public QaraSozService getQaraSozService() {
if (qaraSozService == null) {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("http://localhost:3000")
.addConverterFactory(GsonConverterFactory.create())
.build();
qaraSozService = retrofit.create(QaraSozService.class);
}
return qaraSozService;
}
}
public interface QaraSozService {
@GET("/full")
Call<List<QaraSoz>> getAllQaraSoz();
}
Но я получаю onFailure, когда я пытаюсь подключиться, я получаю сообщение об ошибке, я получаю Failed to connect to localhost/127.0.0.1:3000
![enter image description here](https://i.stack.imgur.com/Ucram.png)
Почему Android пытается подключиться к localhost/127.0.0.1:3000
, а не к localhost: 3000?