Interface HttpClient

All Superinterfaces:
AutoCloseable

public interface HttpClient extends AutoCloseable
An HTTP client.

To create a new HTTP client, use a builder. To send requests and retrieve their responses, use send(java.net.http.HttpRequest, java.net.http.HttpResponse.BodyHandler<T>). To release resources held by the client, use close().

HTTP clients are thread-safe. Each client maintains its own connection pool and SSLContext. For efficiency reasons, clients should be reused whenever possible.