Interface HttpClient

    • Method Detail

      • createRequest

        HttpRequest createRequest​(Method method)
        Creates a new HttpRequest with 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 HttpRequest instance
      • createRequest

        default HttpRequest createRequest​(Method method,
                                          Map<String,​Object> requiredParametersMap,
                                          Map<String,​Boolean> optionsMap)
        Creates a new HttpRequest with the specified HTTP method and replaces placeholders and options in the request URI with the provided parameter values.

        Note that not all HttpClient implementations 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 request
        requiredParametersMap - a map of parameter names to their corresponding values
        optionsMap - the map from option name to enabled/disabled status
        Returns:
        a new HttpRequest instance
      • 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.