Hacker News new | ask | show | jobs
by edanm 4965 days ago
Is there a good book/resource on learning REST API ideas? I'm looking for a beginner's resource for someone who doesn't really grok the ideas behind REST and the motivation for REST. But also something that gets technical very quickly - I've been programming for long enough that I pick ideas up very quickly.
3 comments

I'm sort of with you, though I've read quite a bit at this point and interacted with a number of APIs of varying degrees of "RESTfulness".

The biggest question I wish the various tutorials would address is: why is REST a good idea? Why is this particular way of doing things better than others?

And here's one thing I believe is true, that I have literally never seen in a REST tutorial: sometimes REST is not the best way to go. Sometimes an RPC architecture is better.

"sometimes REST is not the best way to go. Sometimes an RPC architecture is better."

I think that the full versions of there acronyms make a pretty good job of explaining what is best when.

"REpresentational State Transfer": obviously, it transfers state, i.e. information about a certain resource at a given moment. "Remote Procedure Call": obviously, it calls a procedure, which may involve several state changes and other activities. Of course, a procedure may be masked behind a REST endpoint (e.g. when you POST some data and do some procedure before you end up with a certain state) and vice versa (e.g. a simple getter), but you may pretty much view REST as the SQL of the Web, and RPC as stored procedures.

>but you may pretty much view REST as the SQL of the Web, and RPC as stored procedures.

Indeed, but that just raises the question: what would possess you to write an app out of SQL calls rather than general functions? So then why do the Web equivalent thereof?

You don't, of course. What you do is build an app which is using REST to store data somewhere online, and the app itself may be in the user's browser, on a mobile phone or anywhere else for that matter.
Definitely. Just pass that memo along to the "apps should work purely through REST API calls" crowd.
I'd recommend this book http://www.amazon.com/RESTful-Web-Services-Cookbook-Scalabil...

It's amazing, really. It's not just a recipies list, it explains a lot of very important REST cases, and also when to use or not to use REST.

Not your typical book, but it's very good: http://designinghypermediaapis.com/
Interesting. I wasn't sure about buying it, but ended up purchasing. Only after realizing that it was by Steve Klabnik, a name I recognize, probably from HN. I wonder why there isn't more info on the front page, even a sample/TOC would be nice.

I'll be going through it tomorrow, if I remember I'll come back to post a mini review.

This. After seeing the URL posted above, I clicked the link just to see if it was Steve's book. Disappointed he doesn't put his name prominently on the landing page.