开发者

Restlet Representation issue when running with Google App Engine support

My Restlet service works fine when I send it a JSON string, the representation.entity contains the sent text and my restlet resource can do it's thing. However, when I enable GAE support in my eclipse project properties and then run the exact same test, the representation . entity returns a 开发者_如何学编程blank string. I have made sure I am using the latest GAE implementation of Restlet. Any ideas on what else might be causing this?

Update: For anyone who encounters this problem and doesn't want to waste 3 days figuring it out, POST and PUT requests works fine with GAE sdk 1.4.3. I was using the latest GAE sdk 1.5.1 which appears to have introduced a bug around chunk encoding requests


In fact GAE doesn't support HTTP chunked encoding, therefore serialized object can't be sent (via POST or PUT) to a GAE server. From Restlet Framework version 2.1 M4 we have a workaround available that buffers the HTTP entity to prevent chunk encoding. This issue is tracked at the address: http://restlet.tigris.org/issues/show_bug.cgi?id=1219.

To prevent chunk encoding for request you can set the requestEntityBuffering property to 'true' on the ClientResource instance.

Hope it helps you. Thierry

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜