Versioning your RESTful API

Versioning your API: use URL

  1. versioning via the URL: for example GET /v2/users
  2. versioning in query parameters: for example GET /users?version=2
  3. versioning via HTTP headers, for example via the Accept header: Accept: application/json; version=2
  • Easy to use and test
  • Strictly speaking, does not respect REST standards (because additional elements are added in the URL which are not part of resource path in REST meaning)
  • Fully compatible with all tools
  • Multiple resource addresses depending on versions
  • Harder to test
  • Respects REST standards
  • If using a custom header, might not be compatible with all tools
  • One resource address for all versions

--

--

--

Développeur web et passionné de finances personnelles

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How To Create and Deploy a Python Azure Function Using Azure DevOps CI/CD

Understanding Redis Abstract Data types and it’s usages Part — I

Eloquent to SQL: with()

Ubuntu Install Go/Golang

Compiler Writing in Elixir

Creating a multi-domain (SAN) SSL certificate using OpenSSL

Kai Auto Maximizer Update

“Data is the new code”.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Guillaume Viguier-Just

Guillaume Viguier-Just

Développeur web et passionné de finances personnelles

More from Medium

Execute a Java program from NodeJS

API, REST API and RESTful API

Reactive JQuery using Vuex design pattern

Fixing CORS Policy Error in Django-React Application.