0

I have a question that still i have been using PUT and Delete in Web service (REST API) methods for respectively Update a resource and Delete a resource but i am informed now by mobile developers that its not good and always use POST method of HTTP to update and delete. Can i know how far is it true according to current world of technology ?

This is how i used.

Create -> Post
Read   -> Get
Update -> Put
Delete -> Delete

Suggest me the best API documentation that is available online with best practices.

dev1234
  • 5,376
  • 15
  • 56
  • 115
  • [Best online documentation on the different http request methods](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html) – Mark Baker Mar 06 '15 at 08:29

2 Answers2

1

I think the problem is mostly related to some browsers or JavaScript frameworks not properly passing DELETE and PUT on Ajax calls.

There's an overview of the --more or less-- current state for DELETE here:

Are the PUT, DELETE, HEAD, etc methods available in most web browsers?

and here (marked duplicate, but some different answers):

Which browsers don't support a HTTP DELETE with jQuery.ajax?

No mention of mobile browsers in particular, though.

dhke
  • 15,008
  • 2
  • 39
  • 56
1

A lot of frameworks use a hidden input in a post request to tell the server what rest method it "really" is. Like this:

<input type="hidden" name="_METHOD" value="PUT"/>
kylehyde215
  • 1,216
  • 1
  • 11
  • 18