|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoak.external.com.github.droidfu.http.CachedHttpRequest
public class CachedHttpRequest
| Constructor Summary | |
|---|---|
CachedHttpRequest(String url)
|
|
| Method Summary | |
|---|---|
BetterHttpRequest |
expecting(Integer... statusCodes)
Define the set of HTTP status codes which you anticipate to be returned by the server, including error codes you'd like to explicitly handle. |
String |
getRequestUrl()
|
BetterHttpRequest |
retries(int retries)
Set maximum number of retries for this particular request. |
BetterHttpResponse |
send()
Sends the current request. |
org.apache.http.client.methods.HttpUriRequest |
unwrap()
|
BetterHttpRequest |
withTimeout(int timeout)
Set the socket timeout for this specific request. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CachedHttpRequest(String url)
| Method Detail |
|---|
public String getRequestUrl()
getRequestUrl in interface BetterHttpRequestpublic BetterHttpRequest expecting(Integer... statusCodes)
BetterHttpRequestHttpResponseException. This is very useful when dealing with REST-ful Web services,
where it is common to serve error stati that indicate a failure in the application logic
(e.g. 404 if a resource doesn't exist). You typically don't want to treat those as connection
errors, but gracefully handle them like a normal success code.
expecting in interface BetterHttpRequeststatusCodes - the set of status codes that you want to manually handle as part of the response
public BetterHttpRequest retries(int retries)
BetterHttpRequest
retries in interface BetterHttpRequestretries - the maximum number of retries should the request fail
public BetterHttpResponse send()
throws ConnectException
BetterHttpRequest
send in interface BetterHttpRequestConnectExceptionpublic org.apache.http.client.methods.HttpUriRequest unwrap()
unwrap in interface BetterHttpRequestpublic BetterHttpRequest withTimeout(int timeout)
BetterHttpRequest
withTimeout in interface BetterHttpRequesttimeout - the timeout in milliseconds
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||