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.

Ask HN: Why don't people just stick to something universal for APIs?

5 pointsby VertexRedover 8 years ago
Am I the only one that gets annoyed by varying methods used to contact API servers (XML-RPC, SOAP, REST...), not to mention that the output is usually in XML or JSON?<p>What&#x27;s wrong with having RESTful APIs, have all the API examples&#x2F;demos use cURL (I&#x27;ve yet to find a case where a cURL lacks a function for HTTP[s] requests) and finally have all the output in JSON?<p>Now this might be an unpopular opinion so feel free to shower me in downvotes.

6 comments

niftichover 8 years ago
They do stick to trends.<p>The problem is, trends change over time. Back in the early 2000s, SOAP was The Orthodox Way lest you got shunned. In the early 2010s it was HTTP-based templated URLs, JSON payloads usually served as &quot;application&#x2F;json&quot; documented out-of-band, secured with OAuth 2.0 increasingly in favor of other methods. The future is undecided, but new RPC frameworks are being embraced (RPC is no longer a dirty word) [1], and some people are even re-inventing the idea of passing an actual query written in a query language from client to server [2].<p>So, in short, new ideas come along; sometimes new ideas are a re-imagining (or lessons learned) of old ideas. Factors involved in engineering trade-offs change; and finally, some of it is simply fashion.<p>[1] <a href="http:&#x2F;&#x2F;www.grpc.io&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.grpc.io&#x2F;</a><p>[2] <a href="http:&#x2F;&#x2F;graphql.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;graphql.org&#x2F;</a>
bikamonkiover 8 years ago
Simple: existing infrastructure. Just as phasing out petrol-powered vehicles will take decades, so it takes years to move IT infra to the new <i>standards</i>. Add to it this complexity: new ways to solve IT problems arise all the time. Just as now it seems that REST + JSON are the best possible solution, SOAP + XML had the same status a few years back. What will happen when browsers run byte code? Or when we descentralize internet services?
评论 #12740267 未加载
byoung2over 8 years ago
I think the current trend is a rest api with json input&#x2F;output, and an sdk in the popular languages that wraps the api.
评论 #12740282 未加载
eipover 8 years ago
REST and JSON are inefficient and irritating to work with. Websocket with binary protocol like protobuf is much nicer. Even SOAP was much nicer because you could usually code generate a client from a WSDL.
craigcabreyover 8 years ago
Because having a one size fits all mindset is a narrow view to hold.<p>Use cases should drive engineering decisions, not a grand vision of the world in someone&#x27;s head.
throwaway420over 8 years ago
I think we&#x27;ve all been there before...wouldn&#x27;t it be nice if there was one standard way of doing something?<p>Yes and no.<p>Sure, it might make things easier most of the time.<p>But a one-size-fits-all approach might also lead to limited innovation and experimentation.
评论 #12740272 未加载