Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hope to support HTTP2.0 #171

Open
bit4woo opened this issue Jul 20, 2021 · 0 comments
Open

hope to support HTTP2.0 #171

bit4woo opened this issue Jul 20, 2021 · 0 comments

Comments

@bit4woo
Copy link

bit4woo commented Jul 20, 2021

when response use HTTP/2.0 or HTTP/2, can't get body\code correctly. It seems that the JDK don't support HTTP2. I have try same code with JDK8 and JDK16, both show errors. Can you help? Thanks!

HTTP/2 201 Created
Server: SGW
Date: Mon, 19 Jul 2021 11:54:24 GMT
Content-Type: application/json
Content-Length: 154
Allow: GET, POST, HEAD, OPTIONS
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
Vary: Cookie

Exception in thread "main" com.github.kevinsawicki.http.HttpRequest$HttpRequestException: java.io.IOException: Invalid Http response
at com.github.kevinsawicki.http.HttpRequest.stream(HttpRequest.java:1859)
at com.github.kevinsawicki.http.HttpRequest.buffer(HttpRequest.java:1844)
at com.github.kevinsawicki.http.HttpRequest.body(HttpRequest.java:1764)
at toElastic.VMP.upload(VMP.java:60)
at toElastic.VMP.isApiOk(VMP.java:72)
at toElastic.VMP.main(VMP.java:80)
Caused by: java.io.IOException: Invalid Http response
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:2035)
at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:2030)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:2029)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1597)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1577)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at com.github.kevinsawicki.http.HttpRequest.stream(HttpRequest.java:1857)
... 5 more
Caused by: java.io.IOException: Invalid Http response
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1695)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1577)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3206)
at java.base/java.net.URLConnection.getHeaderFieldInt(URLConnection.java:613)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderFieldInt(HttpsURLConnectionImpl.java:396)
at com.github.kevinsawicki.http.HttpRequest.intHeader(HttpRequest.java:2180)
at com.github.kevinsawicki.http.HttpRequest.intHeader(HttpRequest.java:2164)
at com.github.kevinsawicki.http.HttpRequest.contentLength(HttpRequest.java:2560)
at com.github.kevinsawicki.http.HttpRequest.byteStream(HttpRequest.java:1744)
at com.github.kevinsawicki.http.HttpRequest.body(HttpRequest.java:1762)
... 3 more

@bit4woo bit4woo changed the title 希望支持http2.0 hope to support HTTP2.0 Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant