

POST Tunneling: HTTP DELETE and PUT requests with JQuery and Django-Piston - padobson
http://pdobson.com/post/18362073678/post-tunneling-http-delete-and-put-requests-with

======
LoonyPandora
Whilst a nice little article, I need to point out a factual error.

    
    
        The problem with consuming a REST API with client-side
        Javascript with AJAX is that most browsers only give
        access to two HTTP request methods - GET and POST
    

All modern-ish browsers as far back as Firefox 3 and IE 6 support other HTTP
methods when called via JavaScript [1]. It's HTML forms where support for
different methods is not present. If you have an app that relies on JS you can
just use the relevant methods in your .ajax() call.

You can check what methods your browser supports here [2] (JS heavy page, may
slow down your browser)

[1] <http://www.mnot.net/javascript/xmlhttprequest/>

[2] <http://annevankesteren.nl/2007/10/http-method-support>

~~~
padobson
Thanks for the heads up. Both of the clients I mentioned needed to support
IE8, and I couldn't find any reliable info on AJAX support of PUT and DELETE.
This seemed like the most reliable way to get it done. I'll do a follow-up
post on testing the major browsers for PUT and DELETE.

~~~
LoonyPandora
That would be very useful. I struggled to find references to back up my
statement, as the jQuery docs for .ajax() only has a vague "other methods may
not be supported in all browsers" - with no further details.

A simple table showing browser support for different methods in .ajax() calls
would help a lot!

