RESTful API for own python application
dieter at handshake.de
Sun Feb 3 08:25:34 CET 2013
Julio F Schwarzbeck <julio at techfuel.net> writes:
> I am developing an application, the application stores small text
> snippets (think of something similar to evernote), and it has the
> standard CRUD operations of any other application.
> Now my question is, how much would you recommend creating the entire
> CRUD operations as a REST API even for my own program, I plan to have
> a "thin" web client UI to make these operations, but I am thinking
> about creating another client for ubuntu and its phone, for instance,
> and possibly connections from other clients.
REST is very open to the output format.
When you want to use a "thin" web client for human users via REST,
then the output likely must be HTML. For programs,
output with structure designed for programs not humans is usually
better suited (e.g. X-schema described XML or "json").
Therefore, I would expect that you have 2 different "view"s on
your service: one for human users and another one for programs.
Whether your human user view internally uses the REST api for
programs or instead directly use a common internal api
depends partly on personal preferences (some people are extreme
REST fans; others (like me) do not like it at all) and
partly on deployment scenarios (if, e.g., the human user view
must be distributed, then using the REST api for its implementation
would facilitate this).
If possible, I would go for the second option:
REST and human user views both use the same underlaying service api.
More information about the Python-list