Class SimpleHTTPClient


  • @Deprecated
    public class SimpleHTTPClient
    extends Object
    Deprecated.
    Since COMMONS-390. It is recommended to use a CHF Client.
    Simple helper client for connecting to URLs over HTTP and retrieving their contents via a GET request. Settable timeouts on read and connection.
    • Field Detail

      • DEFAULT_READ_TIMEOUT

        public static final int DEFAULT_READ_TIMEOUT
        Deprecated.
        Default read timeout on HTTP requests from this client.
        See Also:
        Constant Field Values
      • DEFAULT_CONNECTION_TIMEOUT

        public static final int DEFAULT_CONNECTION_TIMEOUT
        Deprecated.
        Default connection timeout on HTTP requests from this client.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SimpleHTTPClient

        @Deprecated
        public SimpleHTTPClient()
        Deprecated.
        Since COMMONS-390. It is recommended to use a CHF Client.
        Generates a new SimpleHTTPClient with the appropriate timeouts.
      • SimpleHTTPClient

        @Deprecated
        public SimpleHTTPClient​(int readTimeout,
                                int connTimeout)
        Deprecated.
        Since COMMONS-390. It is recommended to use a CHF Client.
        Generates a new SimpleHTTPClient with the appropriate timeouts.
        Parameters:
        readTimeout - read timeout value (greater than or equal to zero)
        connTimeout - connection timeout value (greater than or equal to zero)
    • Method Detail

      • get

        public String get​(URL url)
                   throws IOException
        Deprecated.
        Utility method for gathering the contents of an HTTP page. Should ideally be in an HTTP Client utils type package, rather than here.
        Parameters:
        url - from which to attempt to retrieve the contents
        Returns:
        The contents of the provided url
        Throws:
        IOException - If there are any problems connecting to or gathering the contents of the page