Package io.ably.lib.http
Class HttpHelpers
java.lang.Object
io.ably.lib.http.HttpHelpers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
ablyHttpExecute
(Http http, String path, 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> T
getUri
(HttpCore httpCore, String uri, Param[] headers, Param[] params, HttpCore.ResponseHandler<T> responseHandler) HTTP GET for non-Ably hoststatic byte[]
Simple HTTP GET; no auth, headers, returning response body as byte[]static String
getUrlString
(HttpCore httpCore, String url) Simple HTTP GET; no auth, headers, returning response body as stringstatic <T> T
httpExecute
(HttpCore httpCore, URL url, 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> T
postSync
(Http http, String path, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth) static <T> T
postUri
(HttpCore httpCore, String uri, Param[] headers, Param[] queryParams, Param[] bodyParams, HttpCore.ResponseHandler<T> responseHandler) HTTP POST with data in form encoding for non-Ably host
-
Constructor Details
-
HttpHelpers
public HttpHelpers()
-
-
Method Details
-
ablyHttpExecute
public static <T> T ablyHttpExecute(Http http, String path, 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
Simple HTTP GET; no auth, headers, returning response body as string- Parameters:
-
httpCore
- -
url
- - Returns:
- Throws:
AblyException
-
getUrl
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, 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, 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, URL url, 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, String path, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth) throws AblyException - Throws:
AblyException
-