Skip to content

Instantly share code, notes, and snippets.

@immutef
Created November 21, 2010 22:29
Show Gist options
  • Save immutef/709230 to your computer and use it in GitHub Desktop.
Save immutef/709230 to your computer and use it in GitHub Desktop.
REST response formats [DRAFT]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body data-version="1.0">
<section role="errors">
<article data-code="404">
Not found
</article>
</section>
<section role="results">
<article id="1">...</article>
<article id="2">...</article>
</section>
</body>
</html>
{ "version":"1.0"
, "errors":[{"code":"404","message":"Not found"}]
, "results":[{"id":"1", ...}, {"id":"2", ...}]}
<?xml version="1.0" encoding="UTF-8"?>
<response>
<version>1.0</version>
<errors>
<error>
<code>404</code>
<message>Not found</message>
</error>
</errors>
<results>
<item id="1">...</item>
<item id="2">...</item>
</results>
</response>
version: 1.0
errors:
- { code: 404, message: Not found }
results:
- { id: 1, ... }
- { id: 2, ... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment