Module java.net.http

Package java.net.http

HTTP Client and WebSocket APIs

Provides high-level client interfaces to HTTP (versions 1.1 and 2) and low-level client interfaces to WebSocket. The main types defined are:

The protocol-specific requirements are defined in theHypertext Transfer Protocol Version 2 (HTTP/2), the Hypertext Transfer Protocol (HTTP/1.1), andThe WebSocket Protocol.

In general, asynchronous tasks execute in either the thread invoking the operation, e.g.sending an HTTP request, or by the threads supplied by the client'sexecutor. Dependent tasks, those that are triggered by returned CompletionStages or CompletableFutures, that do not explicitly specify an executor, execute in the samedefault executor as that of CompletableFuture, or the invoking thread if the operation completes before the dependent task is registered.

CompletableFutures returned by this API will throwUnsupportedOperationException for theirobtrudeValue andobtrudeException methods. Invoking thecancel method on aCompletableFuture returned by this API may not interrupt the underlying operation, but may be useful to complete, exceptionally, dependent stages that have not already completed.

Unless otherwise stated,null parameter values will cause methods of all classes in this package to throwNullPointerException.

Since:
11