- Building Microservices with Go
- Nic Jackson
- 111字
- 2021-07-15 17:28:15
Versioning formats for REST APIs
To allow the client to request a particular API version, there are three common ways you can do this.
It can be done as part of the URI:
https://myserver.com/v1/helloworld
It can also be done as a query string parameter:
https://myserver.com/helloworld?api-version=1
Finally, It can be done by using a custom HTTP header:
GET https://myserver.com/helloworld
api-version: 2
Whichever way you implement versioning is up to you and your team, but it should play a big part in your upfront design thinking. Once you have decided on an option stick, to it as providing a consistent and great experience for your consumers should be one of your primary goals.
推薦閱讀
- Python程序設計教程(第2版)
- Mastering Entity Framework Core 2.0
- 測試驅動開發:入門、實戰與進階
- Redis Essentials
- Modern JavaScript Applications
- Spring Boot進階:原理、實戰與面試題分析
- PHP從入門到精通(第4版)(軟件開發視頻大講堂)
- Emgu CV Essentials
- Web性能實戰
- JQuery風暴:完美用戶體驗
- Python面試通關寶典
- Java編程指南:語法基礎、面向對象、函數式編程與項目實戰
- 機器人ROS開發實踐
- JavaScript高級程序設計(第3版)
- Mastering Web Application Development with Express