Class HttpHelpers


  • public class HttpHelpers
    extends java.lang.Object
    • Constructor Detail

      • HttpHelpers

        public HttpHelpers()
    • 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
      • 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