Associating responses with specific requests using Loopj Android Asynchronous Http Client -


i'm using loopj android asynchronous http client send multiple http requests asynchronously.

i'm using static asynchttpclient suggested , sending multiple http posts , receiving responses on anonymous class. problem when request comes don't know how tie original request.

for instance, in caching situation, when send post , receive 200 ok need able know request response can mark sent.

try this:

public class myasynchttpresponsehandler extends asynchttpresponsehandler {      private string requestid;      public asynchttpresponsehandler(string requestid) {         this.requestid = requestid;     }      @override     public void onsuccess(string arg0)     {         super.onsuccess(arg0);         // use requestid here     } } 

sending request:

client.get(url, new myasynchttpresponsehandler(requestid)) 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -