Skip to content

Tag: google-api

Using google-http-client and google-http-client-apache-v2 behind a proxy produces NonRepeatableRequestException

I’m using google-http-client and google-http-client-apache-v2 libraries to make a POST request behind a proxy. That request produces a NonRepeatableRequestException: It seems like ApacheHttpRequest wraps ByteArrayContent that is repeatable (see JavaDoc) inside a ContentEntity that is non-repeatable. Debuging execution inside google libraries, proxy is returning “407 Proxy Authentication Required”, then it tries to repeat the request (guess that including the credentials)

Get all GCP instances under project using rest API

The below api gives instances based on a particular zone. I am using java client library to connect with GCP. It is possible using gcloud according to this link Any help will be much appreciated. Answer To list all instances in all regions and zones for a project, use the aggregatedList method. Method: instances.aggregatedList