Live data from Hacker News

The Restful CookBook

restcookbook.com

41–50 of 53 posts

Re: The Restful CookBook

#42
post #5

While some of the tips are useful, I'd much rather see them written with JSON rather than XML. JSON has long been an industry standard. XML is bloated, almost no one uses it anymore. http://restcookbook.com/Mediatypes/json/ says "There is no predefined way to deal with link discovery in JSON". I'm surprised it doesn't even mention JSON Schema ( http://json-schema.org/ ) or JSON API ( http://jsonapi.org/ ), which are…

You can submit a pull request on https://github.com/restcookbook/restcookbook

Re: The Restful CookBook

#43
post #7

Whenever I see a REST book I always have the same set of questions: 1) How do I call operations such as Clean, Restart etc not the regular CRUD ones? I may have to end up doing a variation of POST - is that RESTful (whatever that means)? 2) Whats a good way to simulate a "transaction" semantic (In as much as possible over a distributed systems with arbitrary nodes i.e. the Web) 3) How Do I call a long running operati…

Just today I read about postgrest[1], REST-like API for postgresql.

While it is not REST by what this cookbook says (it uses JSON), it provides very different view at how API should work.[2]

Postgrest versions the API using HTTP accept header. It provides "pagination" not using XML attributes, but using HTTP range headers, as the standard allows to specify partial content in items, not just in bytes. The author also suggest that deeply nested URLs are a bad idea, because most data (like relational data) is actually flat.

It might provide interesting "second opinion" to what this cookbook says. It doesn't say anything about transactions,

[1]: https://github.com/begriffs/postgrest [2]: http://begriffs.com/posts/2014-12-30-intro-to-postgrest.html

Re: The Restful CookBook

#44
Fascinating that even here on Hacker News, where we can presume the audience is well-informed about tech matters, the comments on this post show a large amount of confusion about the definition of "RESTful". I see some comments raise the issue of XML versus JSON, as if the encoding format impacts on whether something is RESTful. I see others raising the issue of HATEOAS, with some comments suggesting that RESTful is HATEOAS, and others suggesting that RESTful is a different approach from HATEOAS.

A term that lacks any agreed upon meaning is of no value. But I wonder why the meaning has become so blurry?

I was under the impression that the bible on this subject was the 2007 book by Leonard Richardson, Sam Ruby (and a nice forward by David Heinemeier Hansson):

RESTful Web Services

http://www.amazon.com/RESTful-Web-Services-Leonard-Richardso...

However, reading the comments on this page, I have the impression that many people here have never heard of that book.

Re: The Restful CookBook

#45
post #43
post #7

Whenever I see a REST book I always have the same set of questions: 1) How do I call operations such as Clean, Restart etc not the regular CRUD ones? I may have to end up doing a variation of POST - is that RESTful (whatever that means)? 2) Whats a good way to simulate a "transaction" semantic (In as much as possible over a distributed systems with arbitrary nodes i.e. the Web) 3) How Do I call a long running operati…

Just today I read about postgrest[1], REST-like API for postgresql. While it is not REST by what this cookbook says (it uses JSON), it provides very different view at how API should work.[2] Postgrest versions the API using HTTP accept header. It provides "pagination" not using XML attributes, but using HTTP range headers, as the standard allows to specify partial content in items, not just in bytes. The author also…

>HTTP range headers, as the standard allows to specify partial content in items, not just in bytes

When doing HTTP Range requests, you'd use HEAD to get the complete length first. If your range requests are in items, is it still in spec to specify Content-Length in items too? I'd think that would break some clients.

Re: The Restful CookBook

#46

I just started at a new job, at a new startup. During the my first job interview with them, they asked, "Do you know how to work with a RESTful interface?" I said yes, and I told them to look at my Github account for examples. During my second job interview with them, they asked "What do you consider when you are designing a RESTful interface?" I quoted a bit from the book that Sam Ruby and Leonard Richardson wrote,…

To a good number of people, "REST" means the Web—but not SOAP. Mapping CRUD to HTTP methods, and so forth, completely escapes some people.

"REST good. I want." That's as far as some thinking goes :-(

Re: The Restful CookBook

#47
I only took a quick look at this, but the first thing I looked at was their discussion of POST vs. PUT. I worry about their answer. My understanding is that the fundamental consideration is idempotency, and what you would like that to do for you. I would have started the discussion there, and then added as a footnote the idea of convenience of working with resources. They seem to have done the opposite.

Re: The Restful CookBook

#48

Fascinating that even here on Hacker News, where we can presume the audience is well-informed about tech matters, the comments on this post show a large amount of confusion about the definition of "RESTful". I see some comments raise the issue of XML versus JSON, as if the encoding format impacts on whether something is RESTful. I see others raising the issue of HATEOAS, with some comments suggesting that RESTful is…

When I read the title of the post, I wrongly assumed it linked to the "RESTful Web Services Cookbook", which is another O'Reilly classic on this topic. The advice I've heard is to read one or the other, depending on which prose style you prefer.

It's nice to see a CC-licensed effort to create a similar resource. It's unfortunate that the names are so similar.

Re: The Restful CookBook

#49
post #5

While some of the tips are useful, I'd much rather see them written with JSON rather than XML. JSON has long been an industry standard. XML is bloated, almost no one uses it anymore. http://restcookbook.com/Mediatypes/json/ says "There is no predefined way to deal with link discovery in JSON". I'm surprised it doesn't even mention JSON Schema ( http://json-schema.org/ ) or JSON API ( http://jsonapi.org/ ), which are…

I personally find XML more readable than JSON.

Re: The Restful CookBook

#50
post #7

Whenever I see a REST book I always have the same set of questions: 1) How do I call operations such as Clean, Restart etc not the regular CRUD ones? I may have to end up doing a variation of POST - is that RESTful (whatever that means)? 2) Whats a good way to simulate a "transaction" semantic (In as much as possible over a distributed systems with arbitrary nodes i.e. the Web) 3) How Do I call a long running operati…

Add:

8) How to represent relations (esp. many-to-many) between non-hierarchical resources? The answers I have seen are either variations of "represent the relation as a resource" (is tying the relation resource's lifetime to that of the things related RESTful?), or "represent the relation as a property on both resources" (is it RESTful to reflect the update of a property on one object in another?).

Post reply on HN