You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: