Package io.ably.lib.http
Class HttpHelpers
- java.lang.Object
-
- io.ably.lib.http.HttpHelpers
-
public class HttpHelpers extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description HttpHelpers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TablyHttpExecute(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 necessarystatic <T> TgetUri(HttpCore httpCore, java.lang.String uri, Param[] headers, Param[] params, HttpCore.ResponseHandler<T> responseHandler)HTTP GET for non-Ably hoststatic byte[]getUrl(HttpCore httpCore, java.lang.String url)Simple HTTP GET; no auth, headers, returning response body as byte[]static java.lang.StringgetUrlString(HttpCore httpCore, java.lang.String url)Simple HTTP GET; no auth, headers, returning response body as stringstatic <T> ThttpExecute(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 anystatic <T> TpostSync(Http http, java.lang.String path, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth)static <T> TpostUri(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
-
-
-
Method Detail
-
ablyHttpExecute
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
Make a synchronous HTTP request to an Ably endpoint, using the Ably auth credentials and fallback hosts if necessary- Parameters:
http-path-method-headers-params-requestBody-responseHandler-- Returns:
- Throws:
AblyException
-
getUrlString
public static java.lang.String getUrlString(HttpCore httpCore, java.lang.String url) throws AblyException
Simple HTTP GET; no auth, headers, returning response body as string- Parameters:
httpCore-url-- Returns:
- Throws:
AblyException
-
getUrl
public static byte[] getUrl(HttpCore httpCore, java.lang.String url) throws AblyException
Simple HTTP GET; no auth, headers, returning response body as byte[]- Parameters:
httpCore-url-- Returns:
- Throws:
AblyException
-
getUri
public static <T> T getUri(HttpCore httpCore, java.lang.String uri, Param[] headers, Param[] params, HttpCore.ResponseHandler<T> responseHandler) throws AblyException
HTTP GET for non-Ably host- Parameters:
uri-headers-params-responseHandler-- Returns:
- Throws:
AblyException
-
postUri
public static <T> T postUri(HttpCore httpCore, java.lang.String uri, Param[] headers, Param[] queryParams, Param[] bodyParams, HttpCore.ResponseHandler<T> responseHandler) throws AblyException
HTTP POST with data in form encoding for non-Ably host- Parameters:
uri-headers-queryParams-responseHandler-- Returns:
- Throws:
AblyException
-
httpExecute
public 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
Make a synchronous HTTP request to non-Ably endpoint, specified by URL and using the configured proxy, if any- Parameters:
httpCore-url-method-headers-requestBody-responseHandler-- Returns:
- Throws:
AblyException
-
postSync
public 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
- Throws:
AblyException
-
-