Versioning REST API

后端 未结 6 1894
迷失自我
迷失自我 2020-12-04 10:23

After having read a lot of material on REST versioning, I am thnking of versioning the calls instead of the API. For example:

http://api.mydomain.com/callfoo         


        
6条回答
  •  既然无缘
    2020-12-04 10:35

    Facebook does verisoning in the url. I feel url versioning is cleaner and easier to maintain as well in the real world.

    .Net makes it super easy to do versioning this way:

    [HttpPost]
    [Route("{version}/someCall/{id}")]
    public HttpResponseMessage someCall(string version, int id))
    

提交回复
热议问题