Versioning: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "Versioning is a way for clients to indicate what features they support. == Strategies == As with all interesting engineering problems, approaches to versioning have different...")
 
No edit summary
Line 5: Line 5:


=== Root Folder Versioning ===
=== Root Folder Versioning ===
A common approach is to prefix the API [[URL]] with a version folder: `/api/v1/<rest>`.
A common approach is to prefix the API [[URL]] with a version folder: <code>/api/v1/<rest></code>.


Advantages:
Advantages:
Line 18: Line 18:


=== Version Header ===
=== Version Header ===
A less common approach is to use a [[header]] like `X-API-Version: 1` in API requests. There are two approaches within this strategy that have different tradeoffs.
A less common approach is to use a [[header]] like <code>X-API-Version: 1</code> in API requests. There are two approaches within this strategy that have different tradeoffs.


==== Don't Allow Requests Without Header ====
==== Don't Allow Requests Without Header ====

Navigation menu