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.

A bird's eye view on API development

71 pointsby TheEdonianover 9 years ago

8 comments

Cakez0rover 9 years ago
Why is it considered best practice to use the content type header for API versioning? It always seemed like a hack to me. Url versioning makes much more sense if you consider that your API is a resource and the content of your API is a subresource. E.G. GET /v1/post/1/comment/456 would be semantically equivalent to "give me comment with id 456, which belongs to post with id 1, which belongs to api of version 1".
评论 #10585248 未加载
tompover 9 years ago
Can anyone explain why using different verbs (PUT, PATCH, ...) is preferable to using just POST with an additional parameter (e.g. POST action="add")? It seems like the author's distinction between POST, PUT and PATCH seems rather arbitrary...
评论 #10581671 未加载
评论 #10580552 未加载
评论 #10580675 未加载
seivanover 9 years ago
Good article, summarise what I like and don&#x27;t like.<p>I wish it would delve deeper into versioning with some code samples. The way I&#x27;ve done it in the past is just inherit from a controller and just override an action as well as the json-builder. But that because unmaintainable after version 3 or so.<p>I like how Relay&#x2F;GraphQL sorta abstracts that away, but Ive had a hard time figuring out how to make that work with the ORM (Active Record) so abandoned for now.
评论 #10580345 未加载
christogreeffover 9 years ago
Nice read.<p>Sidenote: Should credit not be given for the use of the xkcd comic?
评论 #10580340 未加载
misegover 9 years ago
The elephant in the room for me is that while HATEOAS is mentioned, the impression I get from posts from developers online is that people program against a pre-agreed API format.<p>That&#x27;s different to REST&#x27;s automated discoverability for REST API clients.
评论 #10580426 未加载
评论 #10580788 未加载
Omnipresentover 9 years ago
This is a great guide. Side note: Is there an example of implementing OAuth2 from API developers perspective and from API Consumers perspective? language agnostic but Go or Java preferred.
评论 #10580429 未加载
评论 #10581958 未加载
sinzoneover 9 years ago
No mention of swagger?
评论 #10580464 未加载
PierreLechelleover 9 years ago
Great into on API development. Thanks for sharing :)
评论 #10580128 未加载