- 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.
推薦閱讀
- UNIX編程藝術(shù)
- 計算機網(wǎng)絡
- 深入理解Android(卷I)
- CMDB分步構(gòu)建指南
- Computer Vision for the Web
- 基于免疫進化的算法及應用研究
- Learn Swift by Building Applications
- PhpStorm Cookbook
- 學習正則表達式
- Mastering Backbone.js
- Greenplum構(gòu)建實時數(shù)據(jù)倉庫實踐
- Web前端開發(fā)最佳實踐
- Learning ROS for Robotics Programming
- Mastering Swift 4(Fourth Edition)
- C#面向?qū)ο蟪绦蛟O計(微課版)