What option are out there for Versioning in HTTP?
- media type versioning -> header accept:application/vnd.service.v2+json
- headers versioning -> custom header apiVersion=1
- URI versioning -> the version goes in the uri path /v1/uri
- request parameter versioning -> the version goes in a argument server/uri?version=1
The first two reduce the URI pollution. They might not work if client is behind a proxy that potentially blocks some headers of the HTTP request.
The bottom two allow caching and bookmarking.
Easy choice it's to stick to bottom ones, more academic approach is to use top ones as one resource should have one and just one endpoint.
https://stackoverflow.com/questions/18905335/rest-versioning-url-vs-header
Sem comentários:
Enviar um comentário