public class HttpRequestHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_TIMEOUT |
| Constructor and Description |
|---|
HttpRequestHelper(ContextHelper contextHelper) |
| Modifier and Type | Method and Description |
|---|---|
void |
doGetCall(java.lang.String urlString,
HttpResponseJSONListener listener)
Method used to do GET calls and parse the response as JSON
|
void |
doGetCall(java.lang.String urlString,
HttpResponseStringListener listener,
int timeout,
long ifModifiedSince)
Method used to do GET calls
|
void |
doPostCall(java.lang.String urlString,
java.lang.String content,
HttpResponseJSONListener listener)
Method used to do POST calls and parse the response as JSON
|
void |
doPostCall(java.lang.String urlString,
java.lang.String content,
HttpResponseStringListener listener)
Method used to do POST calls
|
void |
doPostCall(java.lang.String urlString,
java.lang.String content,
HttpResponseStringListener listener,
int timeout)
Method used to do POST calls with custom timeout
|
public static final int DEFAULT_TIMEOUT
public HttpRequestHelper(ContextHelper contextHelper)
public void doGetCall(java.lang.String urlString,
HttpResponseStringListener listener,
int timeout,
long ifModifiedSince)
urlString - URL to calllistener - listener receiving request responsetimeout - request timeoutifModifiedSince - Timestamp (in ms) for the If-Modified-Since header, or 0.
If the file was not modified on server,
onSuccess will be called with an empty response.public void doGetCall(java.lang.String urlString,
HttpResponseJSONListener listener)
urlString - URL to calllistener - listener receiving request responsepublic void doPostCall(java.lang.String urlString,
java.lang.String content,
HttpResponseStringListener listener)
urlString - URL to callcontent - body content (mandatory)listener - listener receiving request responsepublic void doPostCall(java.lang.String urlString,
java.lang.String content,
HttpResponseStringListener listener,
int timeout)
urlString - URL to callcontent - body content (mandatory)listener - listener receiving request responsetimeout - request timeoutpublic void doPostCall(java.lang.String urlString,
java.lang.String content,
HttpResponseJSONListener listener)
urlString - URL to callcontent - body content (mandatory)listener - listener receiving request response