Google app engine Restlet和GAE的怪异行为
我从安卓客户端获得了Google app engine Restlet和GAE的怪异行为,google-app-engine,restlet,Google App Engine,Restlet,我从安卓客户端获得了googleappengine中的Restlet代码 ClientResource clientResource = new ClientResource(RESTLET_TEST_URL); ProductResource productResource = clientResource.wrap(ProductResource.class); productResource.store(mProduct); Status status = clientResource.g
googleappengine
中的Restlet
代码
ClientResource clientResource = new ClientResource(RESTLET_TEST_URL);
ProductResource productResource = clientResource.wrap(ProductResource.class);
productResource.store(mProduct);
Status status = clientResource.getResponse().getStatus();
Toast.makeText(this, "Status: "+ status.getDescription(), Toast.LENGTH_SHORT).show();
clientResource.release();
.store()
方法类似于PUT请求。奇怪的是,当我连接到开发服务器时,这工作正常,但在实际的AppEngine站点上,什么都没有发生。我刚刚得到状态:OK
,表明请求已通过
我无法进行故障排除,因为我只能在Dev服务器上进行故障排除,而且工作正常
关于问题可能是什么或如何解决这个问题有什么想法吗
作为参考,服务器端的代码为:
if (product != null ) {
if (new DataStore().putToDataStore(product) ) {
log.warning("Product written to datastore");
} else {
log.warning("Product not found in datastore");
}
}
这只是使用
Objectify
对数据存储的简单写入,这是一个已知的问题。看
解决方案是使用clientResource.setEntityBuffering(true)代码>。但是,请注意,此方法仅适用于Android客户端的候选版本,而不适用于稳定版本