Use PATCH verb instead of PUT for "update" #50
Comments
Thanks SlyNet, I've heard about this, sadly I'm not sure we can make the same changes unless the MVC framework supports it. Looking through the HttpVerbs enumeration in System.Web.Mvc it looks like we are limited to what we have. I agree that patch is probably better, but not sure how to proceed. Any ideas? |
We CAN made it, because string representation is used, so if we need PATCH support with can use "PATCH" without any enums. This could be done easily, just adding an alias for put methods. |
I've checked code. Changes need to be made:
Not sure that its all. But anyway in order to support it HttpVerbs enum is not appropriate |
Could you try making those changes and see if they work in a new development environment. My only concern is that Patch isn't turned on initially in IIS, which could create a frustrating experience for developers using this library. In addition, this could be a big breaking change for most people using this library so I wonder what kind of number bump it should get. |
Afraid of the same. Its super breaking change. As for initially enabled verbs - PUT and DELETE are not enabled in IISExpress either |
Well, i guess it is not pulblic api. So changes should not be breaking. And i guess there should be support for both put and patch verbs. |
Let's reach out to the MVC team and see if they are willing to add support for Patch. If they do, then this makes the transition seamless to support it, since it would just mean the addition of the Http Patch enum and a route constraint for Patch. Does that seam like a reasonable way to proceed? The next changes to Restful Routing will probably be making sure it works with MVC4. |
Agree with that. The main concern for me is if it works with WebAPI. See no reason why it should not work with regular actions/controllers |
I submitted a patch to asp.net mvc to support PATCH, so hopefully they accept it. On another note for myself.
|
Patch will be supported in ASP.Net MVC 4 RC. So we should be able to mimic this. |
Yes. I've seen that your pull request was accepted. Its just so cool! :) |
I actually would like to have both. PATCH is for updating a resource, PUT is for replacing it. So when I get a PATCH, I know that my code should only change the form fields, where as when there is a PUT I know to replace the entire resource. |
Rails chaned PUT to Patch for updates. Here are some details rails/rails#348
Should we make the same change?
The text was updated successfully, but these errors were encountered: