Re:Designing HTTP interfaces and RESTful web services
by drawkbox on Sunday February 26, 2012 @02:56PM
(#3636569)
I agree, I am a big fan of REST but what is with the notion that the uri can't be more abstracted? api.twitter.com can be the same as twitter.com/api. They are both resources and they happen to route to the same thing. Not ideal but may be needed in evolving api as it grows like you mention.
This isn't necessarily the best design in the world, but you also can't ignore the real world requirements of operating a site as large as twitter. I suspect it would be more expensive (in many ways) for twitter to direct all traffic to twitter.com and then route it internally based on the accept header.
Versioning on the accept header is, in my mind, the most controversial part of "Hypermedia" API design. Custom mime types add a lot of complexity in the real world, from both the client and server side perspectives. And yet, changing the path in order to access a new resource has many downsides of its own. There's also a question of scale -- adding a bit of new information to existi