5 ms·
The concern is not whether "my web server" will understand PATCH, but whether the random proxy between my web server and the client will; I'm totally willing to
by saurik 15y ago
The concern is not whether "my web server" will understand PATCH, but whether the random proxy between my web server and the client will; I'm totally willing to believe it does (1995 is a long time ago, I've certainly used and heard about PATCH, and even more elaborate WebDAV methods like PROPPATCH are used by Subversion without serious issue), but to ask about the web server and ignore the proxies is disappointing.
- aaronblohowiak 15y ago_method param is used to override the true http method with the one rails should use for routing, so everything can go over vanilla POST
- binarysoul 15y agoyes this is exactly right, its POST for compatibility reasons, rails puts a special parameter in the form submit to map to PUT (for resourceful routes)
- SystemOut 15y agoAs I currently work in the K-12 educational software industry this is something I would be extremely sensitive to. The sheer number of creaky, old proxy servers out there that we have to contend with is mind boggling. I'm sure others have to deal with this to but I suspect that the education market is one where people will run into surprises and most likely won't realize what the issue is right away. As the sibling post pointed out there is way to change the http method used but I suspect most people won't do this or know about this and this is a really really hard thing to QA for.
- tptacek 15y agoI have a hard time believing that Rails programmers will use resource routing and not understand _method. It's pretty fundamental to the way the framework works. Are you a Rails dev? If not, just know: for the most part, we're talking about different flavors of HTTP POST.
- ryanto 15y agoAt the time of reading your comment it is light gray. I am not sure why people are downvoting you... _method is a pretty important part of the rails routing and solves a lot of the proxy/server problems that people are mentioning. In fact, I would argue that things like put/patch/_method are what make Rails so great. Rails makes a lot of strong opinions (put, whoops no, patch!), but then at then end of the day always gives you a way (_method) to deal with any issues where their opinions may not work in your current architecture. This pattern appears throughout the framework and is one of the reasons I really enjoy Rails.
- apike 15y agoThe concern isn't simply that there will be Rails programmers in K-12 that don't know how to override an HTTP method. The concern is that when K-12 users are using Rails 4 apps (that may or may not be K-12 specific) they may fail in bizarre ways that are hard to troubleshoot.
- lparry 15y agoIt's not an issue because web browsers only support GET and POST. Rails works around this by including a hidden field "_method" which contains the method the server should treat the request as.
- justincormack 15y agoThat's not true xmlhttprequest should support all methods but there are some quirks eg see http://www.mnot.net/javascript/xmlhttprequest/ http://www.mnot.net/javascript/xmlhttprequest/ to test though that does not cover PATCH.
- lparry 15y agoI stand corrected, I hadn't thought about js requests
- SystemOut 15y agoThis was more my point that I didn't get across correctly. When apps fail due to weird proxy issues they are incredibly hard to figure out and almost impossible to QA correctly for without a huge budget. And if this causes it, sure the Rails programmer might know how to solve it once they actually realize why it's failing. The why is the harder part.