tag:blogger.com,1999:blog-3454984.post1545190867805910906..comments2023-07-15T03:39:20.802-07:00Comments on Not Invented Here: Unknownnoreply@blogger.comBlogger4125tag:blogger.com,1999:blog-3454984.post-22561590776703695332011-09-20T07:52:46.123-07:002011-09-20T07:52:46.123-07:00If I'm not mistaken browsers are unable to sub...If I'm not mistaken browsers are unable to submit method type PUT or DELETE. Rails is having to compensate for this feature defect by using POST to create.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3454984.post-42395809081775127362011-09-12T10:41:19.171-07:002011-09-12T10:41:19.171-07:00Just a note: maybe I'm totally wrong but I fou...Just a note: maybe I'm totally wrong but I found that older versions of Rails (for example 2.3.10) do not return a 404 status when using an unsupported method on an existent resource, at least for 'member' actions.<br /><br />For example in this case:<br /><br />map.resources :contents, :member => {:some_action => :post}<br /><br />if you try to access to /contents/1/some_action via GET, a 405 Method Not Allowed status is returned.<br /><br />Have this changed in newer versions of Rails? Maybe we should ask the members of the Rails core their reasons to do it ;)valakirkahttps://www.blogger.com/profile/01838638310421189147noreply@blogger.comtag:blogger.com,1999:blog-3454984.post-62757846094034122011-08-12T11:39:43.131-07:002011-08-12T11:39:43.131-07:00What I said about HTTP PUT is generally accepted, ...What I said about HTTP PUT is generally accepted, though I could be more precise.<br /><br />To be precise, then: <br /><br />"The PUT method requests that the enclosed entity be stored under the supplied Request-URI."<br /><br />RFC 2616 also says "If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response."<br /><br />If a PUT request is sent to a URI and a 201 response is returned, a cache can understand that the resource at that URI was created and has the PUT request content, roughly. If a POST request is used, the intermediary does not know what happened. So Rails' use of POST vs PUT has a potential effect on intermediaries getting less information.<br /><br />Rails also does not use the 201 response by default (though you can make it do so like <a href="http://rogue-technology.com/blog/?cat=20" rel="nofollow">this</a>, but part of my argument is that the defaults aren't RESTful.)Lisahttps://www.blogger.com/profile/08832467898664086593noreply@blogger.comtag:blogger.com,1999:blog-3454984.post-28373074535531602332011-08-12T04:58:47.716-07:002011-08-12T04:58:47.716-07:00Show me, where PUT is defined as creating somethin...Show me, where PUT is defined as creating something...Anonymousnoreply@blogger.com