- 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.
推薦閱讀
- 深入核心的敏捷開發(fā):ThoughtWorks五大關(guān)鍵實踐
- Python科學(xué)計算(第2版)
- 密碼學(xué)原理與Java實現(xiàn)
- 架構(gòu)不再難(全5冊)
- SQL Server 2012數(shù)據(jù)庫技術(shù)及應(yīng)用(微課版·第5版)
- R語言游戲數(shù)據(jù)分析與挖掘
- INSTANT Sencha Touch
- Koa開發(fā):入門、進階與實戰(zhàn)
- Hadoop+Spark大數(shù)據(jù)分析實戰(zhàn)
- Mastering RStudio:Develop,Communicate,and Collaborate with R
- Mastering Unity 2D Game Development(Second Edition)
- Service Mesh實戰(zhàn):基于Linkerd和Kubernetes的微服務(wù)實踐
- Spring Boot+MVC實戰(zhàn)指南
- Visual C++從入門到精通(第2版)
- SQL Server on Linux