Interface HttpClientProvider

All Superinterfaces:
Provider

public interface HttpClientProvider extends Provider
Author:
Stian Thorgersen
  • Method Summary

    Modifier and Type
    Method
    Description
    get(String uri)
    Helper method
    org.apache.http.impl.client.CloseableHttpClient
    Returns the CloseableHttpClient that can be freely used.
    int
    postText(String uri, String text)
    Helper method

    Methods inherited from interface org.keycloak.provider.Provider

    close
  • Method Details

    • getHttpClient

      org.apache.http.impl.client.CloseableHttpClient getHttpClient()
      Returns the CloseableHttpClient that can be freely used.

      The returned HttpClient instance must never be close()d by the caller.

      Closing the HttpClient instance is responsibility of this provider. However, the objects created via the returned HttpClient need to be closed properly by the code that instantiated them.

      Returns:
    • postText

      int postText(String uri, String text) throws IOException
      Helper method
      Parameters:
      uri -
      text -
      Returns:
      http response status
      Throws:
      IOException
    • get

      InputStream get(String uri) throws IOException
      Helper method
      Parameters:
      uri -
      Returns:
      response stream, you must close this stream or leaks will happen
      Throws:
      IOException - On network errors, no content being returned or a non-2xx HTTP status code