Tuesday, 27 July 2004
Atom, blojsom, and HTTP PUT
« Search engine friendly URLs in blojsom | Main | Another day ... Another blog »
The Atom client I've tested blojsom's implementation of the Atom API with is ecto. It's a fine client. However, for editing an entry, which is done using an HTTP put on the entry you are editing, we run into the following situation.
The NSURLConnection framework in MacOSX indeed has a bug that causes it not to send the body with HTTP PUT messages. This bug is fortunately already fixed and should appear in a next OS release.In this case, ecto uses SOAP encoding to send the edit using an HTTP POST. The server must then parse the SOAP request and "do the right thing". Fortunately blojsom does the right thing. On the Atom wiki, there's a proposal, PacePutDelete, for clients (e.g. a LOT of Java-enabled mobile phones out there) that cannot execute PUT and DELETE HTTP requests. The alternate proposal at the end seems quite straightforward and doesn't require all the SOAP enabling on the client and server. All that needs to be done on the client is to add a specific HTTP header to indicate the method (say DELETE or PUT) to execute. Handling this on the server is also quite straightforward. In a Java servlet, this would amount to adding some logic to the top of your doPost method to see if the specific Atom header exists and to route to the proper doXXX method accordingly.
Posted by at 8:48 PM in blojsom ... all blojsom
[Trackback URL for this entry]
