quarks.connectors.http

Class HttpClients

  • java.lang.Object
    • quarks.connectors.http.HttpClients


  • public class HttpClients
    extends java.lang.Object
    Creation of HTTP Clients. This methods are called at runtime to create HTTP clients for HttpStreams. They are passed into methods such as
    See Also:
    HttpStreams
    • Constructor Summary

      Constructors 
      Constructor and Description
      HttpClients() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static org.apache.http.impl.client.CloseableHttpClient basic(java.lang.String user, java.lang.String password)
      Create a basic authentication HTTP client with a fixed user and password.
      static org.apache.http.impl.client.CloseableHttpClient basic(Supplier<java.lang.String> user, Supplier<java.lang.String> password)
      Method to create a basic authentication HTTP client.
      static org.apache.http.impl.client.CloseableHttpClient noAuthentication()
      Create HTTP client with no authentication.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpClients

        public HttpClients()
    • Method Detail

      • noAuthentication

        public static org.apache.http.impl.client.CloseableHttpClient noAuthentication()
        Create HTTP client with no authentication.
        Returns:
        HTTP client with basic authentication.
        See Also:
        HttpStreams
      • basic

        public static org.apache.http.impl.client.CloseableHttpClient basic(java.lang.String user,
                                                                            java.lang.String password)
        Create a basic authentication HTTP client with a fixed user and password.
        Parameters:
        user - User for authentication
        password - Password for authentication
        Returns:
        HTTP client with basic authentication.
        See Also:
        HttpStreams
      • basic

        public static org.apache.http.impl.client.CloseableHttpClient basic(Supplier<java.lang.String> user,
                                                                            Supplier<java.lang.String> password)
        Method to create a basic authentication HTTP client. The functions user and password are called when this method is invoked to obtain the user and password and runtime.
        Parameters:
        user - Function that provides user for authentication
        password - Function that provides password for authentication
        Returns:
        HTTP client with basic authentication.
        See Also:
        HttpStreams

Copyright IBM 2015,2016 - 2f6ad0e-20160307-0902