Package io.ably.lib.http
Class HttpCore
- java.lang.Object
-
- io.ably.lib.http.HttpCore
-
public class HttpCore extends java.lang.ObjectHttpCore performs authenticated HTTP synchronously. Internal; use Http or HttpScheduler instead.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpCore.AuthRequiredExceptionException signifying that an httpCore request failed with a WWW-Authenticate responsestatic interfaceHttpCore.BodyHandler<T>Interface for an entity that performs type-specific processing on an httpCore response bodystatic interfaceHttpCore.RequestBodyInterface for an entity that supplies an httpCore request bodystatic classHttpCore.ResponseA type encapsulating an httpCore responsestatic interfaceHttpCore.ResponseHandler<T>Interface for an entity that performs type-specific processing on an httpCore response
-
Constructor Summary
Constructors Constructor Description HttpCore(ClientOptions options, Auth auth, PlatformAgentProvider platformAgentProvider)Public API
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetPreferredHost()Gets host for this HTTP clientjava.lang.StringgetPrimaryHost()Gets host for this HTTP client<T> ThttpExecute(java.net.URL url, java.net.Proxy proxy, java.lang.String method, Param[] headers, HttpCore.RequestBody requestBody, boolean withCredentials, HttpCore.ResponseHandler<T> responseHandler)Make a synchronous HTTP request specified by URL and proxy<T> ThttpExecuteWithRetry(java.net.URL url, java.lang.String method, Param[] headers, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth)Make a synchronous HTTP request specified by URL and proxy, retrying if necessary on WWW-AuthenticatevoidsetPreferredHost(java.lang.String host)Sets host for this HTTP client
-
-
-
Constructor Detail
-
HttpCore
public HttpCore(ClientOptions options, Auth auth, PlatformAgentProvider platformAgentProvider) throws AblyException
Public API- Throws:
AblyException
-
-
Method Detail
-
httpExecuteWithRetry
public <T> T httpExecuteWithRetry(java.net.URL url, java.lang.String method, Param[] headers, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth) throws AblyExceptionMake a synchronous HTTP request specified by URL and proxy, retrying if necessary on WWW-Authenticate- Parameters:
url-method-headers-requestBody-responseHandler-- Returns:
- Throws:
AblyException
-
setPreferredHost
public void setPreferredHost(java.lang.String host)
Sets host for this HTTP client- Parameters:
host- URL string
-
getPreferredHost
public java.lang.String getPreferredHost()
Gets host for this HTTP client- Returns:
-
getPrimaryHost
public java.lang.String getPrimaryHost()
Gets host for this HTTP client- Returns:
-
httpExecute
public <T> T httpExecute(java.net.URL url, java.net.Proxy proxy, java.lang.String method, Param[] headers, HttpCore.RequestBody requestBody, boolean withCredentials, HttpCore.ResponseHandler<T> responseHandler) throws AblyExceptionMake a synchronous HTTP request specified by URL and proxy- Parameters:
url-proxy-method-headers-requestBody-withCredentials-responseHandler-- Returns:
- Throws:
AblyException
-
-