I'm looking for java client that can connect to a HTTP/2 based server.. The server is already supporting HTTP/2 API. I don't see the most popular Apache Http client https://hc.apache.org/ still supporting HTTP/2.
Does Apache have some implementation for Java client already that supports Http/2?
If not, Is there some java client that supports connecting to HTTP/2 preferably on Java 7?
Apache httpclient-5 beta supports http/2 from jdk9 or above
example :
refer : https://hc.apache.org/httpcomponents-client-5.0.x/examples-async.html
Jetty's provides two HTTP/2 Java client APIs. Both require Java 8 and the mandatory use of the ALPN, as explained here.
Low level APIs
These APIs are based on HTTP2Client, it's based on the HTTP/2 concepts of session and streams and uses listeners to be notified of the HTTP/2 frames that arrive from the server.
High Level APIs
Jetty's
HttpClient
provides a way to use different transports, one of which is the HTTP/2 transport. Applications will use the higher level HTTP APIs, but underneath Jetty will use HTTP/2 to transport the HTTP semantic.In this way, applications can use the high level APIs provided by
HttpClient
transparently, and factor out what transport to use in configuration or startup code.There is OkHttp: An HTTP & HTTP/2 client for Android and Java applications.
Jetty has support for HTTP2 starting from version 9.3. This includes the server and the client.