Build 1.0_r1(from source)

android.net.http
Class RequestHandle

java.lang.Object
  extended by android.net.http.RequestHandle

public class RequestHandle
extends Object

RequestHandle: handles a request session that may include multiple redirects, HTTP authentication requests, etc.


Constructor Summary
RequestHandle(RequestQueue requestQueue, String url, WebAddress uri, String method, Map<String,String> headers, InputStream bodyProvider, int bodyLength, Request request)
          Creates a new request session.
 
Method Summary
static String authorizationHeader(boolean isProxy)
           
 void cancel()
          Cancels this request
static String computeBasicAuthResponse(String username, String password)
           
 String getMethod()
           
 void handleSslErrorResponse(boolean proceed)
          Handles SSL error(s) on the way down from the user (the user has already provided their feedback).
 boolean isRedirectMax()
           
 void setupBasicAuthResponse(boolean isProxy, String username, String password)
          Create and queue an HTTP authentication-response (basic) request.
 void setupDigestAuthResponse(boolean isProxy, String username, String password, String realm, String nonce, String QOP, String algorithm, String opaque)
          Create and queue an HTTP authentication-response (digest) request.
 boolean setupRedirect(String redirectTo, int statusCode, Map<String,String> cacheHeaders)
          Create and queue a redirect request.
 void waitUntilComplete()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestHandle

public RequestHandle(RequestQueue requestQueue,
                     String url,
                     WebAddress uri,
                     String method,
                     Map<String,String> headers,
                     InputStream bodyProvider,
                     int bodyLength,
                     Request request)
Creates a new request session.

Method Detail

cancel

public void cancel()
Cancels this request


handleSslErrorResponse

public void handleSslErrorResponse(boolean proceed)
Handles SSL error(s) on the way down from the user (the user has already provided their feedback).


isRedirectMax

public boolean isRedirectMax()
Returns:
true if we've hit the max redirect count

setupRedirect

public boolean setupRedirect(String redirectTo,
                             int statusCode,
                             Map<String,String> cacheHeaders)
Create and queue a redirect request.

Parameters:
redirectTo - URL to redirect to
statusCode - HTTP status code returned from original request
cacheHeaders - Cache header for redirect URL
Returns:
true if setup succeeds, false otherwise (redirect loop count exceeded)

setupBasicAuthResponse

public void setupBasicAuthResponse(boolean isProxy,
                                   String username,
                                   String password)
Create and queue an HTTP authentication-response (basic) request.


setupDigestAuthResponse

public void setupDigestAuthResponse(boolean isProxy,
                                    String username,
                                    String password,
                                    String realm,
                                    String nonce,
                                    String QOP,
                                    String algorithm,
                                    String opaque)
Create and queue an HTTP authentication-response (digest) request.


getMethod

public String getMethod()
Returns:
HTTP request method (GET, PUT, etc).

computeBasicAuthResponse

public static String computeBasicAuthResponse(String username,
                                              String password)
Returns:
Basic-scheme authentication response: BASE64(username:password).

waitUntilComplete

public void waitUntilComplete()

authorizationHeader

public static String authorizationHeader(boolean isProxy)
Returns:
The right authorization header (dependeing on whether it is a proxy or not).

Build 1.0_r1(from source)

Please submit a feedback, bug or feature