The New HTTP Client API in Java 11
summary
Java 11 ships a standardized java.net.http client that replaces HttpURLConnection, supports HTTP/2 and HTTP/1.1, and exposes synchronous and CompletableFuture-based async APIs. It uses Flow reactive interfaces so request/response bodies are handled by pluggable BodyPublisher/BodySubscriber implementations, letting one compute an MD5 on streaming bytes without buffering the whole file. Immutable clients and builders configure executor, timeouts, TLS and HTTP/2 settings, and the API includes server push (PushPromise) handlers and sensible default body handlers.
AI-written summary · about
chapters (29)
- 0:00Introduction
- 0:45New functionality
- 2:58New HTTP Client
- 6:28History of HTTP
- 12:56Client
- 15:36Request
- 15:56Headers
- 16:56Body Publisher
- 17:26HTTP Response
- 19:06Body Handler
- 20:26Ring
- 21:06Push Promise Handler
- 25:58Reactive Interface
- 27:26How it works
- 27:41Publisher and Subscriber
- 28:41Basic Interface
- 29:31Publisher
- 31:51Body
- 32:21Completion
- 35:35Future Completion
- 36:06Create Future
- 36:40Unsubscribe
- 38:16Code
- 38:42Advanced Configuration
- 39:02Advanced Configuration Properties
- 42:26Proxy to SSL
- 43:06HTTP across request builder
- 44:46HTTP 11 standards
- 45:28How we should mirror tomorrow
related talks
01h 05mWhat Took So Long… Java’s New HttpClient
59mGood Things Take Time … Java’s New HttpClient
01h 03mModern Java 21+: The Next-Level Upgrade
55mEffective Java SE 11-21 APIs/Lang Features Makes Your Life Easier.
01h 27mHTTP/2 for the Web developer
43mHTTP 2.0: why and how
01h 02mJava 11 to 21 Evolution!
53mHTTP/2 Two Years Later
