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
I'm trying to update a resource with google-cloud-compute-1.3.0, the client does this using HTTP PATCH. This is not supported with the default NetHttpTransport (#1316):
To workaround that, I set the HTTP transport to ApacheHttpTransport, but then other requests fail with
Caused by: java.lang.IllegalStateException: Apache HTTP client does not support GET requests with content.
at com.google.common.base.Preconditions.checkState(Preconditions.java:469)
at com.google.api.client.util.Preconditions.checkState(Preconditions.java:113)
at com.google.api.client.http.apache.v2.ApacheHttpRequest.execute(ApacheHttpRequest.java:60)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1012)
at com.google.api.gax.httpjson.HttpRequestRunnable.run(HttpRequestRunnable.java:143)
... 6 more
This precondition is run when getContentStreaming() != null:
but in this case getContentStreaming() is returning an com.google.api.client.http.EmptyContet due to googleapis/gax-java#648
I think this precondition needs to be relaxed and be in-line with NetHttpTransport, which does support GET requests with non-null getContentStreaming().
Environment details
Specify the API at the beginning of the title. For example, "BigQuery: ..."). google-cloud-compute-1.3.0
Will fail with the stacktrace above. Removing either .setTransportChannelProvider() or .setHttpTransport() (so that it defaults to NetHttpTransport) will fix this issue (but then PATCH doesn't work).
The text was updated successfully, but these errors were encountered:
I'm trying to update a resource with
google-cloud-compute-1.3.0
, the client does this usingHTTP PATCH
. This is not supported with the defaultNetHttpTransport
(#1316):google-http-java-client/google-http-client/src/main/java/com/google/api/client/http/javanet/NetHttpTransport.java
Lines 68 to 76 in 7ebc6ca
To workaround that, I set the HTTP transport to
ApacheHttpTransport
, but then other requests fail withThis precondition is run when
getContentStreaming() != null
:google-http-java-client/google-http-client-apache-v2/src/main/java/com/google/api/client/http/apache/v2/ApacheHttpRequest.java
Lines 59 to 71 in 7ebc6ca
but in this case
getContentStreaming()
is returning ancom.google.api.client.http.EmptyContet
due to googleapis/gax-java#648I think this precondition needs to be relaxed and be in-line with
NetHttpTransport
, which does supportGET
requests with non-nullgetContentStreaming()
.Environment details
google-cloud-compute-1.3.0
Code example
Will fail with the stacktrace above. Removing either
.setTransportChannelProvider()
or.setHttpTransport()
(so that it defaults toNetHttpTransport
) will fix this issue (but then PATCH doesn't work).The text was updated successfully, but these errors were encountered: