Summary
Incubated in Java 9, the HTTP Client was standardized in Java 11. This chapter started with an introduction to the HTTP Client API, including the factors that led to its creation. Today's web applications and services should be responsive, supporting asynchronous, non-blocking data transfers. The HTTP Client uses Reactive Streams to achieve these goals.
The HTTP Client can be used to access HTTP resources across the network, using either HTTP/1.1 or HTTP/2, in both synchronous and non-synchronous manners. The HTTP Client API consists of three main classes or interfaces: the HttpClient class, the HttpRequest class, and the HttpResponse interface. The HttpClient class is used to send a request and retrieve the corresponding responses; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access