Class HttpClient

java.lang.Object
net.glowstone.net.http.HttpClient

public class HttpClient extends Object
  • Constructor Details

    • HttpClient

      public HttpClient(List<DnsEndpoint> endpoints)
      Creates an HttpClient configured to hit the given DNS endpoints.
      Parameters:
      endpoints - The DNS endpoints to use for resolving domains. If the list is empty, then
  • Method Details

    • connect

      public void connect(String url, io.netty.channel.EventLoop eventLoop, HttpCallback callback)
      Opens a URL.
      Parameters:
      url - the URL to download
      eventLoop - an EventLoop that will receive the response body
      callback - a callback to handle the response or any error