[dev] REST support
Chuck Hagenbuch
chuck at horde.org
Fri Dec 19 02:51:55 UTC 2008
Quoting Brandon Ramirez <brandon.s.ramirez at gmail.com>:
> I'm working on a project using the Horde framework for the infrastructure
> and part of that involves playing around with web services. I've been
> looking at Horde_RPC and I'm wondering if Horde has any framework for
> supporting REST? It looks like it'll only work with SOAP, XML-RPC and a few
> other protocols.
I don't know that "only" is appropriate here, but you are correct that
there is not currently a REST API. Depending on what you want the
access for, you might find the json-rpc backend useful. I would
recommend either json-rpc or XML-RPC.
> Am I mistaken? Given the nature of REST, is there any code re-use that
> could be abstracted into a framework, or is each REST endpoint typically
> different enough that it should just be a standalone PHP script? (Yes, I'm
> very new to web services). If there's anything I can do to help with this,
> I'd be interested in working on it (once I learn more about how it all
> works).
We briefly had an RPC backend called REST. However, since it didn't
have any sort of api-mac (request token) requirement, it was
essentially vulnerable to cross-site request forgery. Also, it was
RESTful only in the vaguest sense, since what it really did was make
RPC calls available via HTTP.
I would like to reintroduce something like this. I don't think it's
possible to make a truly restful API on top of the current Horde API
system, as it would just be mapping procedure calls. However, I think
we should have an HTTP-accessible API, using OAuth for permissioning,
which could be built on the existing system
(http://bugs.horde.org/ticket/7270). And, some of the tools we're
building for Horde 4 (Horde_Routes, Horde_Controller, etc.) will make
it easier to make restful components for Horde apps.
-chuck
More information about the dev
mailing list