From the course: Advanced Web APIs with ASP.NET Core 8
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Versioning options - ASP.NET Core Tutorial
From the course: Advanced Web APIs with ASP.NET Core 8
Versioning options
- [Instructor] There are different ways how we can tackle API versioning, and these are the three most common ones. The first approach I'd like to discuss, and later also demonstrate, is to use a specific HTTP header for the API version. We will be using X-API-Version, but that's not a fixed name that you absolutely have to use. I've prefixed the HTTP header name with an X so that it's clear that it's an unofficial header name. Of course, you could pick something else and we'll see how that is set up. What we could also do is reuse an existing header, the Accept HTTP header, which usually tells the API which data type the client expects and the version could be part of that expected data type. We'll use the simple approach with the separate HTTP header for the version number though. Another approach would be to put the version number in the URL, for instance, like this, /v1.0/products. We are prefixing the path with the version number. That would help us to keep different API versions…
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.
Contents
-
-
-
-
(Locked)
Introduction: API versioning29s
-
(Locked)
Versioning options2m 54s
-
(Locked)
NuGet versioning packages2m 54s
-
(Locked)
Implementing URL versioning9m 12s
-
(Locked)
Implementing header versioning3m 51s
-
(Locked)
Using the Accept header for versioning2m 40s
-
(Locked)
Implementing query string versioning2m 12s
-
(Locked)
Versioning minimal APIs7m 58s
-
(Locked)
Versioning and Swagger4m 14s
-
(Locked)
-
-