3 ms·
Isn't it just a bit naive to just assume that every HTTP-based API call is going to work together? What fields does it return? Do they post XML? JSON? These t
by eli 18y ago
Isn't it just a bit naive to just assume that every HTTP-based API call is going to work together?
What fields does it return? Do they post XML? JSON? These things are both important and hard to get right. Even if you settle on a technical format, you'd still need to agree on fields for every single different kind of content (otherwise it's "headline" and "body" on my blog system and "title" and "contents" on yours). That's why this hasn't happened yet.
I've dealt with some truly awful HTTP-based APIs before. The kind that use some homegrown XML that doesn't validate. It's not nearly enough to say "I've got an API, here's the URL, POST some data to it"
- calambrac 18y agoI'm curious, what's your point, exactly? That we shouldn't do this at all because it might not be perfect out of the gate? If it doesn't work, then it doesn't work, and you'll just whine at the person who broke it until its fixed, or use a different implementation that does work. Yay, loose coupling.
- eli 18y agoNo, certainly the world would be better if everything had an API. But without standards, things are never going to "just work" together. We may as well just encourage people to use semantic HTML and microformat and scrape data off the pages when we want it.
- calambrac 18y agoThere are plenty of standards right now, why doesn't everything "just work together" yet? Ad-hoc apis can be frustrating, but at least they don't make you suffer under the illusion that there's some magical perfection you're missing out on if only that wrinkle in how they implemented the standard got ironed out. Loose coupling, tolerance of fucked-uppedness, etc., are why the web works at all. The web standards movement is dead, long live the web.
- eli 18y agoThings like what? My web server works with a phenomenal number of browsers and clients because they all more-or-less follow the HTTP spec. It just works. And it's more than just frustrating, it makes the idea presented by the OP basically impossible. If you have to add your own processing layer on top of the API, then it loses the magic of having one site ping another. The web works because browsers and such are tolerant of deviations from the standard. The web works because it has standards, not in spite of them. You couldn't say "just connect to my server on port 80 and, uh, we'll figure out how to exchange data"
- calambrac 18y agoOf course there has to be some kind of minimal agreement, I didn't mean to imply otherwise. This idea, "POST to some url on some action", that's pretty minimal. You were arguing it was too little and wouldn't work, I was arguing it was just enough to build on without collapsing under the weight of expectations of miracles. HTTP is a remarkably simple and straightforward spec compared to some others, and HTTP servers are amazingly tolerant. As a client, you can get a lot of work done knowing only GET and POST and ignoring all the different kinds of errors and redirects. I would hold up HTTP as evidence supporting what I'm saying. Same with html. Yes, we all want our beautiful and perfect html, and we curse browsers that don't implement the specs, but honestly, renderers are so forgiving. As long as you're in the ballpark, you're going to get something something useful. SOAP, otoh. The WS-* specs. What utter misery to work with, with their outright lies about out-of-the-box complex interoperability.
- turtle3 18y agoI am guessing the assumption is that each service that allows hook specification also identifies the info it would be posting. ie: Enter a webhook you would like to be POSTed to when you receive a tweet. The webhook will be appended with the following url-encoded fields: sender, time, message. Whatever URL you specify as your webhook needs to be able to handle it. The burden is on you to make sure that you integrate successfully with what is being POSTed. It is actually a pretty nice method of ensuring that a service can inter operate with a large number of other systems without the service provider having to know about them all. I don't think the assumption is that you can just enter any old URL and it will magically work. I think the power is behind it is that it is simple enough that: a) any service can trivially implement their end of it b) anyone interested in extending the service can trivially implement their end of it I'm sure someone doing part b will decide they need to take the post and form an XML message and relay it to a web-service, but it isn't really necessary.