API versioning
"erewh0n" <[email protected]>
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <[email protected]> |
When versioning an API a common approach is to specify version information in the URI. I'm curious how others have solved (or would solve) this problem from a RESTful perspective. I'm aware of the recommendation to use the content-type header for specifying version information, however I am concerned that routing and load balancing features would suffer. So for example if we versioned an API with api.example.com/orders/v1 and api.example.com/orders/v2, it is straightforward to route requests for v1 to one set of web servers and route requests for v2 to another set of web servers. Facilitating this based on HTTP headers is more complex and requires more "plumbing". This is also true in-code, where URI mapping semantics are first-order concerns for many libraries (e.g. using Web API or ServiceStack, etc, it is straightforward to map URIs to controllers or contracts). Anyway, it would be interesting to hear other people's feedback on this issue. Thanks.