com.stackmob.sdk.callback
Interface StackMobRedirectedCallback


public interface StackMobRedirectedCallback

This callback can be supplied to StackMob so that it will be called if the StackMob platform issues a redirect. You should use this callback to cache the new URLs. here is a sample callback:

 new StackMobRedirectedCallback() {
   public void redirected(HttpRequest origRequest, HttpResponse response, HttpRequest newRequest) {
       try {
           URI uri = new URI(newRequest.getRequestLine().getUri());
           cache(uri.getHost);
       }
        catch (URISyntaxException e) {
           handleException(e);
       }
   }
 }
 
 


Method Summary
 void redirected(String originalUrl, Map<String,String> redirectHeaders, String redirectBody, String newURL)
          Invoked when a redirect has been issued
 

Method Detail

redirected

void redirected(String originalUrl,
                Map<String,String> redirectHeaders,
                String redirectBody,
                String newURL)
Invoked when a redirect has been issued

Parameters:
originalUrl - the url being redirected from
redirectHeaders - headers that came with the redirect
redirectBody - the body that came with the redirect
newURL - the url being redirected to


Copyright © 2013 StackMob. All Rights Reserved.