|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.net.http.Request
class Request
Represents an HTTP request for a given host.
| Field Summary | |
|---|---|
(package private) boolean |
mCancelled
True if request has been cancelled |
(package private) EventHandler |
mEventHandler
The eventhandler to call as the request progresses |
(package private) int |
mFailCount
|
(package private) boolean |
mHighPriority
True if request is .html, .js, .css |
(package private) HttpHost |
mHost
Host serving this request |
(package private) BasicHttpRequest |
mHttpRequest
The Apache http request |
(package private) String |
mPath
The path component of this request |
(package private) HttpHost |
mProxyHost
Set if I'm using a proxy server |
| Constructor Summary | |
|---|---|
Request(String method,
HttpHost host,
HttpHost proxyHost,
String path,
InputStream bodyProvider,
int bodyLength,
EventHandler eventHandler,
Map<String,String> headers,
boolean highPriority)
Instantiates a new Request. |
|
| Method Summary | |
|---|---|
(package private) void |
addHeader(String name,
String value)
Add header represented by given pair to request. |
(package private) void |
addHeaders(Map<String,String> headers)
Add all headers in given map to this request. |
(package private) void |
cancel()
Data will not be sent to or received from server after cancel() call. |
(package private) void |
complete()
|
(package private) void |
error(int errorId,
int resourceId)
Helper: calls error() on eventhandler with appropriate message This should not be called before the mConnection is set. |
(package private) EventHandler |
getEventHandler()
|
(package private) String |
getHostPort()
|
(package private) String |
getUri()
|
void |
handleSslErrorResponse(boolean proceed)
Handles SSL error(s) on the way down from the user (the user has already provided their feedback). |
(package private) void |
readResponse(AndroidHttpClientConnection httpClientConnection)
Receive a single http response. |
(package private) void |
reset()
If this request has been sent once and failed, it must be reset before it can be sent again. |
(package private) void |
sendRequest(AndroidHttpClientConnection httpClientConnection)
Send the request line and headers |
(package private) void |
setConnection(Connection connection)
|
String |
toString()
for debugging |
(package private) void |
waitUntilComplete()
Pause thread request completes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
EventHandler mEventHandler
BasicHttpRequest mHttpRequest
String mPath
HttpHost mHost
HttpHost mProxyHost
boolean mHighPriority
volatile boolean mCancelled
int mFailCount
| Constructor Detail |
|---|
Request(String method,
HttpHost host,
HttpHost proxyHost,
String path,
InputStream bodyProvider,
int bodyLength,
EventHandler eventHandler,
Map<String,String> headers,
boolean highPriority)
method - GET/POST/PUThost - The server that will handle this requestpath - path part of URIbodyProvider - InputStream providing HTTP body, null if nonebodyLength - length of body, must be 0 if bodyProvider is nulleventHandler - request will make progress callbacks on
this interfaceheaders - reqeust headershighPriority - true for .html, css, .cs| Method Detail |
|---|
void setConnection(Connection connection)
connection - Request served by this connectionEventHandler getEventHandler()
void addHeader(String name,
String value)
name - of headervalue - of headervoid addHeaders(Map<String,String> headers)
void sendRequest(AndroidHttpClientConnection httpClientConnection)
throws HttpException,
IOException
HttpException
IOException
void readResponse(AndroidHttpClientConnection httpClientConnection)
throws IOException,
ParseException
httpClientConnection - the request to receive the response for.
IOException
ParseExceptionvoid cancel()
String getHostPort()
String getUri()
public String toString()
toString in class Objectvoid reset()
void waitUntilComplete()
void complete()
public void handleSslErrorResponse(boolean proceed)
void error(int errorId,
int resourceId)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||