2

i am making call for rest api by using retrofit

Call<ResBean> call = stackOverflowAPI.createUser(m);
    call.enqueue(new Callback<ResBean>() {
        @Override
        public void onResponse(Response<ResBean> response, Retrofit retrofit) {

        }


        @Override
        public void onFailure(Throwable t) {

        }
    });

now in response if i get one then i will hit new api and then after getting response of 2nd api then i have to hit 1st api . is any way i can save that .

say 1st api - www//one.com and in this if i get one then i will hit 2nd api - www//two.com and once i get response then again i have to hit 1st api which but in 1st api if i get two then i will display result . and this will be for all api, so need to be module of this

any way to do ? caching or somethings ?

andro
  • 1,007
  • 1
  • 14
  • 32
  • Use caching or temporary files for storing such response data. [Sample app](http://wptrafficanalyzer.in/blog/android-temporarily-writing-and-reading-files-to-cache-directory/) – V_J Dec 14 '15 at 07:04
  • but for one url with post params dont u think this option would be little but overhead ? – andro Dec 14 '15 at 07:08
  • Try this for an instance. http://stackoverflow.com/questions/29119253/retrofit-okhttp-client-how-to-cache-the-response – V_J Dec 14 '15 at 07:13
  • http://stackoverflow.com/a/23392019/5634508 this is one i am trying but problem is it giving me error ,any idea what is status import ? and also for void success Override giving error – andro Dec 14 '15 at 07:24

0 Answers0