You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Manik Singla <sm...@gmail.com> on 2017/09/21 04:32:32 UTC

http2 with http Client 5.0 alpha 2

Hey

I am trying to use http2 using http Client 5.0 alpha 2. I copied example
from
https://hc.apache.org/httpcomponents-client-5.0.x/httpclient5/examples/org/apache/hc/client5/http/examples/AsyncClientHttp2ServerPush.java
to see what all should I take care in my code.
But I am unable to make this example code work. I have tried different URLs
in example like https://google.com.

But example itself fails with "Frame size exceeds maximum" in default size
and "org.apache.hc.core5.http2.H2CorruptFrameException: Corrupt or
incomplete HTTP2 frame" when I increase the frame.

I read the code by following stack trace but did not get what should be
done.
I am sure if it has seen tried by many already. So, could someone suggest

Regards
Manik Singla
+91-9996008893
+91-9665639677

"Life doesn't consist in holding good cards but playing those you hold
well."

Re: http2 with http Client 5.0 alpha 2

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2017-09-21 at 10:02 +0530, Manik Singla wrote:
> Hey
> 
> I am trying to use http2 using http Client 5.0 alpha 2. I copied
> example
> from
> https://hc.apache.org/httpcomponents-client-5.0.x/httpclient5/example
> s/org/apache/hc/client5/http/examples/AsyncClientHttp2ServerPush.java
> to see what all should I take care in my code.
> But I am unable to make this example code work. I have tried
> different URLs
> in example like https://google.com.
> 
> But example itself fails with "Frame size exceeds maximum" in default
> size
> and "org.apache.hc.core5.http2.H2CorruptFrameException: Corrupt or
> incomplete HTTP2 frame" when I increase the frame.
> 

This usually happens when one forces the use of HTTP/2 (like in
syncClientHttp2ServerPush example) but the server responds with a
HTTP/1.1 message to a HTTP/2 request.

Please consider moving to HttpClient 5.0-alpha2-SNAPSHOT [1] and
posting your complete code here

Oleg

[1] https://github.com/apache/httpcomponents-client master


> I read the code by following stack trace but did not get what should
> be
> done.
> I am sure if it has seen tried by many already. So, could someone
> suggest
> 
> Regards
> Manik Singla
> +91-9996008893
> +91-9665639677
> 
> "Life doesn't consist in holding good cards but playing those you
> hold
> well."

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org