com.stackmob.sdk.net
Class HttpRedirectHelper

java.lang.Object
  extended by com.stackmob.sdk.net.HttpRedirectHelper

public class HttpRedirectHelper
extends Object


Field Summary
static int RedirectStatusCode
           
 
Constructor Summary
HttpRedirectHelper()
           
 
Method Summary
static org.apache.http.client.methods.HttpRequestBase getRedirect(org.apache.http.client.methods.HttpRequestBase oldRequest, org.apache.http.HttpResponse response)
          get the new request that represents the redirect if there is one
static boolean isRedirected(org.apache.http.HttpResponse response)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RedirectStatusCode

public static final int RedirectStatusCode
See Also:
Constant Field Values
Constructor Detail

HttpRedirectHelper

public HttpRedirectHelper()
Method Detail

getRedirect

public static org.apache.http.client.methods.HttpRequestBase getRedirect(org.apache.http.client.methods.HttpRequestBase oldRequest,
                                                                         org.apache.http.HttpResponse response)
                                                                  throws org.apache.http.ProtocolException,
                                                                         URISyntaxException
get the new request that represents the redirect if there is one

Parameters:
oldRequest - the original request that you made
response - the response that came back
Returns:
the new request to make. NOTE: if a redirect happened, setURI will be called on oldRequest and the result is returned, so your original request will be modified in place.
Throws:
org.apache.http.ProtocolException - if there is a problem parsing headers to get the redirect URL
URISyntaxException - if there is a problem parsing the redirect URL

isRedirected

public static boolean isRedirected(org.apache.http.HttpResponse response)


Copyright © 2011 StackMob. All Rights Reserved.