Interface HttpClient

All Known Implementing Classes:
SimpleHttpClient

public interface HttpClient
Define the behaviour of a HTTP client.
Since:
4.0.0
  • Field Details

    • BEAN_NAME_HTTPCLIENT_TRUST_STORE

      static final String BEAN_NAME_HTTPCLIENT_TRUST_STORE
      Bean name for the client implementation that supports CAS trust store.
      See Also:
    • BEAN_NAME_HTTPCLIENT_NO_REDIRECT

      static final String BEAN_NAME_HTTPCLIENT_NO_REDIRECT
      Bean name for the client implementation that does not follow redirects.
      See Also:
    • BEAN_NAME_HTTPCLIENT

      static final String BEAN_NAME_HTTPCLIENT
      Bean name for the default client implementation.
      See Also:
  • Method Details

    • sendMessageToEndPoint

      boolean sendMessageToEndPoint(HttpMessage message)
      Sends a message to a particular endpoint. Option of sending it without waiting to ensure a response was returned. This is useful when it doesn't matter about the response as you'll perform no action based on the response.
      Parameters:
      message - The message that should be sent to the http endpoint
      Returns:
      boolean if the message was sent, or async was used. false if the message failed.
      Since:
      4.1.0
    • sendMessageToEndPoint

      HttpMessage sendMessageToEndPoint(URL url)
      Contact the URL endpoint as a GET and return the resulting http message.
      Parameters:
      url - the url
      Returns:
      the http message
    • isValidEndPoint

      boolean isValidEndPoint(String url)
      Make a synchronous HTTP(S) call to ensure that the url is reachable.
      Parameters:
      url - the url to call
      Returns:
      whether the url is valid
    • isValidEndPoint

      boolean isValidEndPoint(URL url)
      Make a synchronous HTTP(S) call to ensure that the url is reachable.
      Parameters:
      url - the url to call
      Returns:
      whether the url is valid
    • wrappedHttpClient

      org.apache.hc.client5.http.classic.HttpClient wrappedHttpClient()
      Gets wrapped http client.
      Returns:
      the wrapped http client
    • httpClientFactory

      HttpClientFactory httpClientFactory()
      Gets http client factory.
      Returns:
      the http client factory