[Ocs] OCS and MIME types

Henri Bergius henri.bergius at iki.fi
Fri Jun 17 05:12:42 PDT 2011


On Fri, Jun 17, 2011 at 12:49 PM, Frank Karlitschek <karlitschek at kde.org> wrote:
> This should be fixed with 2.0

If you don't mind, I'll keep these in the API tests also for 1.6,
since sending XML or JSON "as HTML" is kind of bad.

Another question is how wrong API methods should be asked. With the
test server, if I run for example
http://api.test.opendesktop.org/v1/person/foo I get "200 OK" as
response with this body:

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>failed</status>
  <statuscode>999</statuscode>
  <message>please check the syntax. api specifications are here:
http://www.freedesktop.org/wiki/Specifications/open-collaboration-services
debug output:
http request method: GET
http request uri: /v1/person/foo
</message>
 </meta>
</ocs>

Would probably be better to send this with a 404 already with v1, as
otherwise all those wrong routes will be indexed by search engines,
proxies etc.

Sending a nice XML-formatted error message on failures is good, though. :-)

> Frank

/Henri

-- 
Henri Bergius
Motorcycle Adventures and Free Software
http://bergie.iki.fi/

Jabber: henri.bergius at gmail.com
Microblogs: @bergie


More information about the Ocs mailing list