views:

61

answers:

2

Especially for the majority of browsers that don't support it, is there anything aside from just strict standards compliance that justifies the extra development time?

+1  A: 

There's a pretty interesting article on this very subject here: http://www.artima.com/lejava/articles/why_put_and_delete.html

A slight extract:

PUT and DELETE are in the middle between GET and POST. The difference between PUT or DELETE and POST is that PUT and DELETE are idempotent, whereas POST is not. PUT and DELETE can be repeated if necessary. Let's say you're trying to upload a new page to a site. Say you want to create a new page at http://www.example.com/foo.html, so you type your content and you PUT it at that URL. The server creates that page at that URL that you supply. Now, let's suppose for some reason your network connection goes down. You aren't sure, did the request get through or not? Maybe the network is slow. Maybe there was a proxy server problem. So it's perfectly OK to try it again, or again—as many times as you like. Because PUTTING the same document to the same URL ten times won't be any different than putting it once. The same is true for DELETE. You can DELETE something ten times, and that's the same as deleting it once.

David Neale
As that article says, though, browsers don't really support put and delete. Is there any reason to go and emulate through post as opposed to just using post?
aharon
Browsers might not support put and delete - that doesn't mean the it's not handled by the servers (where the idempotence matters). Now that more developers are taking advantage of technologies like AJAX it's becoming less of an issue that you cannot use them in HTML forms.
David Neale
Or to put it another way: browsers *do* support them, only HTML forms don't. However, there are many other ways that a browser may submit data than just via HTML forms. ECMAScript is one, Flash is one, Java, Silverlight, you name it.
Jörg W Mittag
+2  A: 

If you develop your web application only for browser, you should go with post and get.

But e.g. REST-APIs should/could make use of the put and delete methods. So you could better define what action you want to execute on special resources. http://en.wikipedia.org/wiki/Representational_State_Transfer

TooAngel
How about web applications using client-side scripts to communicate with the server via web services?
David Neale
Yeah, you are right. I put e.g. before the REST-API because it was the first example I thought of. There are multiple reasons for put/delete methods. Web services is a good buzz word for it. :)
TooAngel
that makes sense, thanks.
aharon