Retrofit2不发送请求,但也不报错?
后台没有接到请求,我使用的是异步请求,也不走回调函数,就跟什么都没发生一样。代码如下:
接口:
public interface RequestInterface {
@HTTP(method = "post",path = "getAllPath")
Call<List<VedioPath>> getAllVedioPath();
}
mainActivity:
Retrofit builder = new Retrofit.Builder()
.baseUrl("http://localhost:9003/")
.addConverterFactory(JacksonConverterFactory.create())
.build();
RequestInterface requestInterface = builder.create(RequestInterface.class);
Call<List<VedioPath>> allVedioPath = requestInterface.getAllVedioPath();
allVedioPath.enqueue(new Callback<List<VedioPath>>() {
@Override
public void onResponse(Call<List<VedioPath>> call, Response<List<VedioPath>> response) {
System.out.println("........");
}
@Override
public void onFailure(Call<List<VedioPath>> call, Throwable t) {
}
});