Up:: CSharp
HTTP Header-based versioning in ASP.NET Core
HTTP Header-Based Versioning
In this type, we have to send the version in the Http header when we call the controller. So open the Startup.cs
and add the below line of code into services.AddApiVersioning
method. Also, delete the version mentioned in routes.
Now enable the Http herder versioning type. When a client consumes the API, they have so send x-api-version
into the header with specific version value to call the correct controller. (View Highlight)
Additional Metadata
- Type::note
- Origin:: API Versioning in ASP.NET Core
- Status::
- Tags::