0xDECAFBAD

It's all spinning wheels and self-doubt until the first pot of coffee.

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

  • Ok, here's an idea. I've been using TiddlyWiki to keep track of my brain, GTD type things, and anything else that comes to mind. I was looking at the time it would take to build something very similar to what you have done -- TiddlyWiki stores all of it's data within itself, and is a perfectly portable wiki completely implemented in javascript. I can use it on my laptop with no internet connection whatsoever. I would like to sync it up to a databse though, so that I can access teh same data form other computers. I think what you're building might work pefcetly for this.