Web API versioning using accept header04:33

  • 0
Published on May 8, 2017

Text version of the video

Slides

All ASP .NET Web API Text Articles and Slides

All ASP .NET Web API Videos

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic

In this video we will discuss
What is Accept header
Versioning a Web API Service using the standard accept header

What is Accept header
The Accept header tells the server in what file format the browser wants the data. These file formats are more commonly called as MIME-types. MIME stands for Multipurpose Internet Mail Extensions.

In Part 5 of this Web API tutorial we discussed that, if you want the
Web API service to return data in XML format you set the Accept header to application/xml
Web API service to return data in JSON format you set the Accept header to application/json

Versioning a Web API Service using the accept header
Instead of creating a custom header, just for versioning purpose, we can use the standard Accept header. We can add parameters to the Accept header to send any additional data along with the request to the server. For example, we can specify the version of the service we want using the version parameter.

All we have to do now is, read the version parameter value from the Accept header in our CustomControllerSelector class. Please refer to the following article for the code used in the demo.

https://cafeadobro.ro/

https://www.stagebox.uk/wp-includes/depo10-bonus10/

depo 25 bonus 25

https://parfumschristianblanc.com/

Enjoyed this video?
"No Thanks. Please Close This Box!"