Я использую Retrofit в Android studio - java. Я пытаюсь отправить http-запрос на указанный c ip, и когда я пытаюсь прослушать пакеты во время работы приложения в эмуляторе, я не вижу ни одного http-пакета в списке, который был отправлен на указанный сервер. c ip.
Здесь я пытаюсь отправить http-запросы:
IService service = retrofit.create(IService.class);
Call<LoginResponse> call = service.Login(loginRequest);
call.enqueue(new Callback<LoginResponse>() {
@Override
public void onResponse(Call<LoginResponse> call, Response<LoginResponse> response)
{
Response = response.body();
}
@Override
public void onFailure(Call<LoginResponse> call, Throwable t) {
Response = new LoginResponse("Error with the communication with the server!", null);
}
});
return (LoginResponse) Response;
Это мой сервис:
public interface IService
{
@POST("api/users/login")
Call<LoginResponse> Login(@Body LoginRequest loginRequest);
}
Не могу понять, где Я поступил неправильно. Спасибо.