|
|
|
Ask HN: Why don't people just stick to something universal for APIs?
|
|
5 points
by VertexRed
3534 days 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? What's wrong with having RESTful APIs, have all the API examples/demos use cURL (I've yet to find a case where a cURL lacks a function for HTTP[s] requests) and finally have all the output in JSON? Now this might be an unpopular opinion so feel free to shower me in downvotes. |
|
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 "application/json" 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].
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.
[1] http://www.grpc.io/
[2] http://graphql.org/