public class HttpHelpers
extends java.lang.Object
| Constructor and Description |
|---|
HttpHelpers() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
ablyHttpExecute(Http http,
java.lang.String path,
java.lang.String method,
Param[] headers,
Param[] params,
HttpCore.RequestBody requestBody,
HttpCore.ResponseHandler<T> responseHandler,
boolean requireAblyAuth)
Make a synchronous HTTP request to an Ably endpoint, using the Ably auth credentials and fallback hosts if necessary
|
static <T> T |
getUri(HttpCore httpCore,
java.lang.String uri,
Param[] headers,
Param[] params,
HttpCore.ResponseHandler<T> responseHandler)
HTTP GET for non-Ably host
|
static byte[] |
getUrl(HttpCore httpCore,
java.lang.String url)
Simple HTTP GET; no auth, headers, returning response body as byte[]
|
static java.lang.String |
getUrlString(HttpCore httpCore,
java.lang.String url)
Simple HTTP GET; no auth, headers, returning response body as string
|
static <T> T |
httpExecute(HttpCore httpCore,
java.net.URL url,
java.lang.String method,
Param[] headers,
HttpCore.RequestBody requestBody,
HttpCore.ResponseHandler<T> responseHandler)
Make a synchronous HTTP request to non-Ably endpoint, specified by URL and using the configured proxy, if any
|
static <T> T |
postSync(Http http,
java.lang.String path,
Param[] headers,
Param[] params,
HttpCore.RequestBody requestBody,
HttpCore.ResponseHandler<T> responseHandler,
boolean requireAblyAuth) |
static <T> T |
postUri(HttpCore httpCore,
java.lang.String uri,
Param[] headers,
Param[] queryParams,
Param[] bodyParams,
HttpCore.ResponseHandler<T> responseHandler)
HTTP POST with data in form encoding for non-Ably host
|
public static <T> T ablyHttpExecute(Http http, java.lang.String path, java.lang.String method, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth) throws AblyException
http - path - method - headers - params - requestBody - responseHandler - AblyExceptionpublic static java.lang.String getUrlString(HttpCore httpCore, java.lang.String url) throws AblyException
httpCore - url - AblyExceptionpublic static byte[] getUrl(HttpCore httpCore, java.lang.String url) throws AblyException
httpCore - url - AblyExceptionpublic static <T> T getUri(HttpCore httpCore, java.lang.String uri, Param[] headers, Param[] params, HttpCore.ResponseHandler<T> responseHandler) throws AblyException
uri - headers - params - responseHandler - AblyExceptionpublic static <T> T postUri(HttpCore httpCore, java.lang.String uri, Param[] headers, Param[] queryParams, Param[] bodyParams, HttpCore.ResponseHandler<T> responseHandler) throws AblyException
uri - headers - queryParams - responseHandler - AblyExceptionpublic static <T> T httpExecute(HttpCore httpCore, java.net.URL url, java.lang.String method, Param[] headers, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler) throws AblyException
httpCore - url - method - headers - requestBody - responseHandler - AblyExceptionpublic static <T> T postSync(Http http, java.lang.String path, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth) throws AblyException
AblyException