I want to disable GZipContent for a Google Cloud Endpoints class so that a POST can work on the local development server.
The latest GPE release generates this endpoint
For those that are Googling for the error I saw, it was java.io.EOFException, but only in the development server. Here's how I was able to fix this, using the example stated in the OP's question:
Myendpoint myendpointClient = new Myendpoint.Builder(
AndroidHttp.newCompatibleTransport(),
new GsonFactory(),
credential).build();
EndpointService svcCall = myendpointClient.endpointService("firstArg");
// Note, I didn't call "execute()", as normal!
svcCall.setDisableGZipContent(true);
// This is also a handy place to set http headers, etc
svcCall.getRequestHeaders().set("x-oddballhdr","OddballValue");
// It's now time to call execute()
svcCall.execute();
That may be a bit simpler than the other helpful answers.