Soap, REST, xmlrpc. Facebook, twitter, [insert web 2.0 site]. What is the definitive web API and which would be the one that you would most likely replicate in your own code and for what reason? It seems that some web APIs invoke nausea in developers while other invoke pure worship. If you were told to develop an API for a website/product which would you emulate (even if it was overkill)?
问题:
回答1:
Products from 37signals have great APIs, using RESTful XML-over-HTTP. The documentation is reasonably good, too.
回答2:
HTTP itself.
The primitives provided are expressive, yet general enough to be applied to a vast range of problems. The APIs that turn my hair grey are ones that make unwarrented assumptions about how I am going to use them. HTTP is beautifully non-prescriptive.
回答3:
The Google GDATA set of APIs - I use the YouTube one - extends Atom, which is a standard in its own right, so time spent developing with it is also time spent learning about this RSS-type protocol, which gives it an edge over more proprietary ones IMHO.
回答4:
Flickr's API is pretty good: http://www.flickr.com/services/api/
Spent a few months working with it and found it pretty usable. The docs are great too, which many have made it seem that much easier.
REST, JSON/XML/PHP/SOAP protocols, every endpoint is namespaced, lots of options/parameters for every request. Error messages and codes are documented too.
Most of all it lets you access just about all information Flickr stores about its photos and users (with appropriate permissions, of course). Gotta love good APIs!