[Koha-devel] RFC: /svc/ API

Reed Wade reed at typist.geek.nz
Wed Jul 23 12:09:10 CEST 2014


Just to add my bits regarding rest style APIs because I've been making a
lot of those lately:


- sticking with GET and POST may simplify things because they're just a lot
more typical and you're less likely to run into odd problems with less well
tested lib and proxy support
- a great rule of thumb is POST for writes and GET for reads; this makes it
intentionally harder to compose a url that accidentally writes anything
- avoid emitting HTML, the cool kids are letting the browser do all the
work now

Some folks will not like the next bit of advice because it's not pure REST.
I like to never return http error responses for API level exceptions.
Instead I like to provide a "success" boolean value in the json response
and a text explanation in a separate variable.

-reed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20140723/99669758/attachment.html>


More information about the Koha-devel mailing list