http://codereview.appspot.com/32088/diff/1/2
Complete details in the patch, but for inline ease, here's the
os:HttpRequest response format:
// @format='text' example
{data: {
content: 'Hi there!',
status: 200,
headers: {'Content-Type': ['text/plain;charset=utf-8']}
}}
// @format='json' example
{data: {
content: {'hi': 'there!'},
status: 200,
headers: {'Content-Type': ['application/json;charset=utf-8']}
}}
// 404 error
{error: {
code: 404,
message: 'Resource not found'
}}
// Unparseable JSON
{error: {
code: 406
}}
... and here's how error handling deals with network-level errors for
Javascript:
<script xmlns:os="http://ns.opensocial.org/2008/markup"
type="text/os-data">
<os:ViewerRequest key="vwr"/>
<os:PeopleRequest key="vf" userId="@viewer" groupId="@friends"/>
</script>
If the above request failed with a server error, the resulting
dataset would contain content resembling:
{vwr: {error: {message: 'Server error', code: 500}}, vf: {error:
{message: 'Server error', code: 500}}}
-- Adam
Still ok with thisJ
+1
Arne—if there are no objections by EOD, please commit this edit Thursday AM. http://codereview.appspot.com/32088/