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

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -