Batch requests throws 404 not found

2019-08-08 04:15发布

问题:

I'm using the Google Apps Java client library to develop an Android application. I am trying to send a batch request as explained here.

This is my request code for the discovery endpoint, which you can see has a batchPath field with "batch" as value:

BatchRequest batchRequest = mApi.batch(); 

mApi.insert(mEntity).queue(batchRequest, callback); 

batchRequest.execute();

However I keep getting a 404 error. I have already deployed my rebuilt project and double checked the API url. Why is my request not reaching my generated endpoint?

回答1:

Unfortunately, Cloud Endpoints doesn't support REST batching (which the Java client library is trying to use). One can use JSON-RPC for batching, but most client libraries are REST-based, rather than RPC-based.