From 7c46a9df1fa3994bc112b336994663b0616909d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20Ar=C8=9B=C4=83ri=C8=99i?= Date: Fri, 21 Sep 2012 15:22:38 +0200 Subject: [PATCH] added documentation about API errors --- popcorn/templates/api.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/popcorn/templates/api.html b/popcorn/templates/api.html index 4126c47..8183311 100644 --- a/popcorn/templates/api.html +++ b/popcorn/templates/api.html @@ -51,5 +51,21 @@

Warning!

The API is currently unstable and may change h3. Errors +Errors set the proper HTTP code and return a message stored in the @error@ field: + +pre. $ curl -i --header "Accept: application/json" http://popcorn.opensuse.org/NotFound + +pre.. +HTTP/1.0 404 NOT FOUND +Content-Type: application/json +Content-Length: 53 +Server: Werkzeug/0.8.3 Python/2.7.3 +Date: Fri, 21 Sep 2012 13:17:23 GMT + +{ + "error": "Not Found" +} + + {% endfilter %} {% endblock %}