android - May I know how retrofit support 304 Not Modifield? -


anyone know how retrofit support 304 not modifield? because right retrofit throw error. using etag check whether json should update or not.

@get("/imageslist.json") response fetch(@header("if-none-match") string etag); 

that how handle right 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) {         //nothing update         response = e.getresponse();     } else {         log.e("retrofit", e.getmessage(), e);     } } 

is there better way? sorry poor english.


Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

php - Redirect and hide target URL -