api访问没有问题
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("http://服务器IP/SaveImg")
.addConverterFactory(GsonConverterFactory.create())
.client(new OkHttpClient())
.build();
Api imgService = retrofit.create(Api.class);
Call<List<ImgUrl>> call = imgService.getImgUlrs("20151119");
call.enqueue(new Callback<List<ImgUrl>>() {
@Override
public void onResponse(Response<List<ImgUrl>> response, Retrofit retrofit) {
Log.d(TAG, response.code() + "");
}
@Override
public void onFailure(Throwable t) {
}
});
}
public interface Api {
@GET("/DouBanGirl")
Call<List<ImgUrl>> getImgUlrs(@Query("date") String date);
}
public static class ImgUrl {
public String date;
public List<String> ulrs;
public ImgUrl(String date, List<String> ulrs) {
this.date = date;
this.ulrs = ulrs;
}
}
为什么自己的访问一直是404?
小弟拜谢,这个问题困扰很久。
貌似把你的DouBanGirl前面的斜杠去了