Safari Can’t REST

I’ve been working on an authentication system for TurboGears and my forthcoming Content Management System.

I really wanted to support a REST interface to the admin console. For example:

GET /admin/user/jeff HTTP/1.1
Accept: text/javascript

Should return a JSON formatted object containing my user record. That actually works great.

The admin console will interact with the server by creating Ajax requests on the REST interface. Seems reasonable, right?

Except Safari translates the PUT and DELETE methods into GET methods. I suppose I should be happy that I can use GET and POST.

UPDATE: This is a known bug in Safari’s XMLHttpRequest object. Now I wonder whether it will be fixed anytime soon.

Comments

elliott cable June 21st, 2007 @ 10:30 am

I don’t know if you’ve worked with rails, but this is something we always have to work around with REST - we use hidden form fields dictating what type of method it SHOULD have been d-: