Web API Basic Questions

1. What is Web API Content Negotiation?
Ans : According to “accept” value the server side response type is called Content Negotiation.
Example : 
XML format : application/xml
JSON format : application/json
2. Media type formatter : According to client request web api response for that type data (like json or xml). This formatter are one kind of classes. These are called media type format.
MediaTypeFormatter is an abstract class from where JsonMediaTypeFormatter and 

XmlMediaTypeFormatter classes inherit.

3. It is by default possible to call an API from a project into another project?
Ans : No.

4. How can we call an API from a project to another project?
Ans : 1. By using type jsonp or
          2. Microsoft.AspNet.WebApi.Cors package

Leave a Reply