sexta-feira, 27 de janeiro de 2023

HTTP versioning

 What option are out there for Versioning in HTTP?


  1. media type versioning -> header accept:application/vnd.service.v2+json
  2. headers versioning -> custom header apiVersion=1
  3. URI versioning -> the version goes in the uri path /v1/uri
  4. 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