I'm trying connect to localhost:3000/full
with Retrofit on 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();
}
But i get onFailure when i try connect, i get error message i get Failed to connect to localhost/127.0.0.1:3000
Why android try connect to localhost/127.0.0.1:3000
but not localhost:3000?