From the course: Advanced ASP.NET Web API 2.2
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Route versioning
From the course: Advanced ASP.NET Web API 2.2
Route versioning
- [Tutor] In the route version link, the URL is changed. And that is how the URL decides which API version to use. So for example, that I say, we have the, api slash v1 students. In this case, the response that we're going to get is going to be a JSON or XML file with the data that come from the API version one. The same way, if we specify v2 in our URL, then we are going to use the version two API to get a response. Let us go now to Visual Studio and see how we can use this versioning method. If we run our application the way it is, so let us, right click, and then go to set a start a project, and then click this play button here. If we write in here, api, and then students v1, for this students v1 controller, we're going to get the version one response, so here we have just a FullName, the GPA and Id. And if we write in here, v2, then we are going to get the second response and we see that in here we have the Age…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.