...

/

Creating a Web Service for the Northwind Database

Creating a Web Service for the Northwind Database

Learn about using content negotiation to return data in various formats in Web API controllers, contrasting with MVC controllers.

Unlike MVC controllers, Web API controllers do not call Razor views to return HTML responses for website visitors to see in browsers. Instead, they use content negotiation with the client application that made the HTTP request to return data in formats such as XML, JSON, or X-WWW-FORM-URLENCODED in their HTTP response.

The client application must then deserialize the data from the negotiated format. The most used format for modern web services is JavaScript Object Notation (JSON) because it is compact and ...