An Experiment in REST and XML
Okay, so I finally got the second of today's demos running on the server here. Take a look at this chunk of a shell transcript:
One of the first things this should show is just how great cURL can be for testing REST-based web services. The second thing you should see is the web service I threw together at this URL:
Here's the gist: I'm trying to make something like a cross between an XML database and a wiki, with a REST API. The URLs in the system give access to the XML documents as resources. Not only that, you can navigate paths into elements in the XML files themselves.
These URLs mostly support GET, PUT, and DELETE HTTP methods. (No POST, yet.) You can GET documents and elements within documents. You can PUT documents and replace elements within documents. You can DELETE documents and elements within documents.
This thing is barely useful in its present state, but I'm hoping to work a little XmlHTTPRequest mojo to join my outliner, some paragraph editing with some purple number inspiration, and maybe a few other things together into something interesting.
But, who knows if I'll ever get the pieces together--or if I've even got my head on straight about how all this will work. I'm throwing this out there in a very early, probably broken state in the hopes of getting a sanity check or maybe giving someone else some useful code if I wander off and abandon it.
Speaking of the code, look over here in my Subversion repository:
There's not much there yet, and some of it is half broken stuff I hope to make work with Berkeley DB XML, but there you have it.
Archived Comments