Java 26 (releasing March 17th) brings several updates to the java.net.http.HttpClient. The headline addition is HTTP/3 support via JEP 517, with HTTP/2 remaining the default. Four strategies are outlined for handling HTTP/3 connectivity: optimistic HTTP/3-first, parallel HTTP/3 and HTTP/2 requests, pessimistic HTTP/2-first with ALT_SVC discovery, and HTTP/3-only mode. Other changes include a new BodyPublishers.ofFileChannel() method for uploading file regions, a fix for SSLParameters signature schemes being ignored during TLS handshake, an extended request timeout that now covers response body consumption, removal of Content-Length headers on non-POST/PUT requests without a body (per RFC9110), a NoSuchFileException to FileNotFoundException mapping fix, and a Max-Age cookie attribute precedence fix per RFC 6265.
Table of contents
HTTP/3 SupportUploading File RegionsSignature Schemes and Named Groups Usage FixTimeout UpdateContent-Length Removed for non-POST/PUT RequestsMissing File Exception UpdateMax-Age UpdatesSort: