Class Proxy

java.lang.Object
kong.unirest.core.Proxy

public class Proxy extends Object
represents basic proxy settings When this is used to configure the client it sets the following: Proxy host and port are configured as a simple java.net.ProxySelector and set as the default selector Username and password are configured as a single java.net.Authenticator which will apply to ALL auth challenges (not just the proxy)
  • Constructor Details

    • Proxy

      public Proxy(String host, Integer port)
      Construct just based on host and port
      Parameters:
      host - hostname
      port - the port
    • Proxy

      public Proxy(String host, Integer port, String username, String password)
      Construct with all the things
      Parameters:
      host - hostname
      port - the port
      username - username for authentication
      password - password for authentication
  • Method Details

    • getHost

      public String getHost()
      Returns:
      the host
    • getPort

      public Integer getPort()
      Returns:
      the port
    • getUsername

      public String getUsername()
      Returns:
      the username for authentication
    • getPassword

      public String getPassword()
      Returns:
      the password
    • isAuthenticated

      public boolean isAuthenticated()
      Returns:
      indicates that the username and password have been configured.