News for hackers. Stuff that matters.
Re:On RESTful API Standards – Just Be Cool: 11 Rules for Pra... by ajross on Tuesday May 01, 2012 @01:11PM (#3915367)
Does this really rise to the level of an "ARGH!"? I mean, look: REST is nice because it simplifies front end network APIs that were getting out of hand. That is its value.

Replacing the nonsense of SOAP and XML-RPC with equally ridiculous pedantry about HTTP minutiae is not helping your cause nor your software.

Re:On RESTful API Standards – Just Be Cool: 11 Rules for Pra... by tvon on Tuesday May 01, 2012 @02:26PM (#3915727)
There are all of nine HTTP methods, using them correctly should not be that difficult.

edit: Well, ajross has a point. There are actually all of eight HTTP 1.1 methods, and PATCH is not one of them.

Re:On RESTful API Standards – Just Be Cool: 11 Rules for Pra... by ajross on Tuesday May 01, 2012 @02:41PM (#3915803)
The cargo-cult fallacy that there is a "correct" way to do something as complicated and varied as web service provision is exactly the kind of nonsense I'm talking about.

It is "easy" to blindly follow any rule. In most cases it is also wrong.

Re:On RESTful API Standards – Just Be Cool: 11 Rules for Pra... by pfraze on Tuesday May 01, 2012 @03:15PM (#3915951)
There is a good reason to adhere to common usage for the common verbs, though: you can meet expectations better. We generally know what to expect out of GET because it's used consistently.
Re:On RESTful API Standards – Just Be Cool: 11 Rules for Pra... by tvon on Tuesday May 01, 2012 @03:05PM (#3915914)
I'm talking about the correct way to use a HTTP method as defined by the HTTP specification.

> It is "easy" to blindly follow any rule. In most cases it is also wrong.

Come on.

Re:On RESTful API Standards – Just Be Cool: 11 Rules for Pra... by ajross on Tuesday May 01, 2012 @03:25PM (#3915988)
Then you are speaking from ignorance. PATCH is not part of the HTTP specification. It's defined in an IETF RFC (5789) upon which the ink is not yet dry (March 2010, and in fact it's not even stable: the most recent errata was 31 days ago).

Feeling entitled to making firm pronouncements about "correct" behavior on subjects one is not an expert in (and let's be clear: no one is an expert on PATCH yet) is in some sense the very definition of "cargo cult mentality".

Edit: that's probably harsher than it's intended. My point isn't really about PATCH, which seems sane. It's about the pedantic mentality which is running rampant in the REST community (c.f. the "ARGH!" above), which in my mind is taking a good idea and polluting it with terrible nonsense in the pursuit of "purity". Think of what happened to Agile if you continue down this path.

Re:On RESTful API Standards – Just Be Cool: 11 Rules for Pra... by tvon on Tuesday May 01, 2012 @03:33PM (#3916017)
Well shit, my mistake.
Re:On RESTful API Standards – Just Be Cool: 11 Rules for Pra... by grabastic on Tuesday May 01, 2012 @03:50PM (#3916092)
Great edit. I was starting to wonder what all the opposition to PATCH was about.
Re:On RESTful API Standards – Just Be Cool: 11 Rules for Pra... by superasn on Tuesday May 01, 2012 @03:11PM (#3915927)
Also how do you make a PUT or PATCH request from programming languages like Actionscript (and quite possibly Javascript though I'm not sure) which only support POST and GET requests currently?
Re:On RESTful API Standards – Just Be Cool: 11 Rules for Pra... by grabastic on Tuesday May 01, 2012 @03:43PM (#3916059)
Many frameworks overload the POST operation and allow the desired verb to be specified in the data.

Rack::MethodOverride does this for Rack-based apps by using the value of the _method parameter as the http verb.

Re:On RESTful API Standards – Just Be Cool: 11 Rules for Pra... by alexchamberlain on Tuesday May 01, 2012 @04:20PM (#3916213)
FYI Javascript supports PUT. I suppose firewalls could be a problem...
Re:On RESTful API Standards – Just Be Cool: 11 Rules for Pra... by alexchamberlain on Tuesday May 01, 2012 @04:24PM (#3916228)
As someone else said, the API is the UI for the developer. It should be as intuitive and straight forward as possible. I would expect PUT to replace a resource at a specific URL and POST to create a resource under a URL. Therefore, to do a partial update, we need a new verb.

Having said that, I like subresource URLs and using PUT to do partial updates like that.