dart-lang/pub-dartlang — pull request #119 by nex3 (2013-05-29 23:34:00+00:00)
Title: API Overhaul

This does a pretty thorough overhaul of the API, with the following goals:

* Making it better follow modern API best practices ([HATEOAS](http://en.wikipedia.org/wiki/HATEOAS), encoding semantics in the media type).
* Making it easier to provide new, potentially backwards-incompatible, API versions in the future.
* Providing more information in API requests.

The most salient user-visible results of this overhaul are that the API lives underneath https://pub.dartlang.org/api now, rather than being in parallel to the HTML site; and that versioning is done with the `Accept` header.

When a client makes a request to the pub.dartlang.org API, it should include an `Accept` header in the following form: `application/vnd.pub.+json`. `` should be replaced with the expected API version (current `v2`). The server will then respond with a response in a format compatible with the given API version, or with a 406 Not Acceptable response if that version is no longer supported.

The old API will continue to be supported for the near future, although once traffic has dropped off sufficiently we'll turn it down.