TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The RESTful CookBook

129 pointsby bencevansabout 12 years ago

6 comments

GhotiFishabout 12 years ago
<a href="http://restcookbook.com/Resources/pagination/" rel="nofollow">http://restcookbook.com/Resources/pagination/</a><p><pre><code> "Even though it's tempting to create your own pagination scheme by "building" URLs, you should only use the information given by the API. This means, you cannot assume that the 3rd page can be found at /collection/3. If you do, your client will break as soon as the API changes its pagination behaviour." </code></pre> Is that a legitimate caveat?<p>Are there clients that don't break when you change the API the client works with? Pretty smart clients.
评论 #5470454 未加载
评论 #5470383 未加载
评论 #5470356 未加载
评论 #5470325 未加载
glitchdoutabout 12 years ago
Cool idea. But it doesn't seem to be finished. Here's an example: <a href="http://restcookbook.com/Basics/loggingin/" rel="nofollow">http://restcookbook.com/Basics/loggingin/</a><p>Maybe it wasn't the author that submitted this? Or is the author asking for some help?
评论 #5469748 未加载
评论 #5470210 未加载
weixiyenabout 12 years ago
Is my API RESTful when I use (only) JSON? NO.<p>There is no predefined way to deal with link discovery in JSON.<p>:(
评论 #5470823 未加载
评论 #5471523 未加载
evvabout 12 years ago
<a href="http://restcookbook.com/Basics/hateoas/" rel="nofollow">http://restcookbook.com/Basics/hateoas/</a> - What is HATEOAS and why is it important for my REST API?<p>This page doesn't even try to explain why HATEOAS is important. And I'm not sure that it is.<p>This example uses some arbitrary xml to describe the API, but if no client can consistently read and understand it, what purpose does it serve?
drdaemanabout 12 years ago
Many examples do not comply to HTTP standard at all, they're just schematic sketches. I mean, required headers are missing, response bodies are not separated from headers and so on.<p>I believe, examples must be as real-world as possible. Say, the PATCH example must add at least an Content-Type header (and probably use RFC5261), otherwise an important aspect's lost.
评论 #5472396 未加载
Hydraulix989about 12 years ago
Spelling error on /Basics/hateoas/: "deposit" misspelled as "desposit" twice in the second XML code listing.
评论 #5470099 未加载