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);
}
}
}
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 fromredirectHeaders - headers that came with the redirectredirectBody - the body that came with the redirectnewURL - the url being redirected to
Copyright © 2013 StackMob. All Rights Reserved.