Does anyone know how to update support for 304 Not Modifield? Because now there will be an error to modify. I use etag to check if json should be updated or not.
@GET("/imageslist.json") Response fetch(@Header("If-None-Match") String etag);
This is how I process it now
ImageService service = restAdapter.create(ImageService.class);
Response response = null;
try {
response = service.fetch("\"vENxxg\"");
} catch (RetrofitError e) {
if (e.getResponse().getStatus() == HttpURLConnection.HTTP_NOT_MODIFIED) {
response = e.getResponse();
} else {
Log.e("Retrofit", e.getMessage(), e);
}
}
Is there a better way? Sorry for my poor English.
source
share