Interface HttpClient
-
- All Superinterfaces:
AutoCloseable,Closeable
public interface HttpClient extends Closeable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidclose()HttpRequestcreateRequest(Method method)Creates a newHttpRequestwith the specified HTTP method.default HttpRequestcreateRequest(Method method, Map<String,Object> requiredParametersMap, Map<String,Boolean> optionsMap)Creates a newHttpRequestwith the specified HTTP method and replaces placeholders and options in the request URI with the provided parameter values.default booleanhasCapability(HttpProviderCapability capability)Returns true if this HTTP client has the requested capability.booleanisProcessingException(Exception e)Check whether the given exception is a “processing exception”, e.g.default voidupdateEndpoint(String baseTarget)Deprecated.
-
-
-
Method Detail
-
createRequest
HttpRequest createRequest(Method method)
Creates a newHttpRequestwith the specified HTTP method.Contrary to
createRequest(Method, Map, Map), no placeholders will be replaced.The oci-java-sdk-common library will only call this
createRequest(Method)method if hasCapability(StandardHttpProviderCapability#PARAMETERIZED_ENDPOINTS) returns false.- Parameters:
method- the HTTP method for the request- Returns:
- a new
HttpRequestinstance
-
createRequest
default HttpRequest createRequest(Method method, Map<String,Object> requiredParametersMap, Map<String,Boolean> optionsMap)
Creates a newHttpRequestwith the specified HTTP method and replaces placeholders and options in the request URI with the provided parameter values.Note that not all
HttpClientimplementations support parameterized endpoints. If an implementation does not support it, a warning will be logged and the request will be created without replacing any parameters or options.The oci-java-sdk-common library will only call this
createRequest(Method, Map, Map)method if hasCapability(StandardHttpProviderCapability#OPTIONS_IN_ENDPOINTS) returns true.- Parameters:
method- the HTTP method for the requestrequiredParametersMap- a map of parameter names to their corresponding valuesoptionsMap- the map from option name to enabled/disabled status- Returns:
- a new
HttpRequestinstance
-
close
void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
isProcessingException
boolean isProcessingException(Exception e)
Check whether the given exception is a “processing exception”, e.g.a json parse failure.
-
updateEndpoint
@Deprecated default void updateEndpoint(String baseTarget)
Deprecated.Updates the endpoint URL used by this HTTP client instance.- Parameters:
baseTarget- A string representing the new base target URL for all subsequent requests made through this client.
-
hasCapability
default boolean hasCapability(HttpProviderCapability capability)
Returns true if this HTTP client has the requested capability.By default, this method returns false, indicating that no specific capabilities are supported. Subclasses may override this method to provide their own capabilities.
- Returns:
- true if this HTTP client has the requested capability.
-
-