The Web API is a relatively broad concept. Here we mention that the Web API specifically refers to the ASP.
In this article we mainly describe the main features of the Web API and the comparison with other types of frameworks , and finally, some relatively complex examples show how to build HTTP services through the Web API , while also showing the visual Studio builds a variety of powerful. NET projects.
What is a Web API
Two key points--can be connected to a variety of clients (browsers, mobile devices), the framework of Building HTTP services .
The WEB API positions itself in the ASP. NET Framework, with SIGNALR as the framework for building the service.
The Web API is responsible for building HTTP general Services,
And SINGALR is mainly responsible for building real-time services, such as stocks, chat rooms, online games and other real-time requirements of high-quality services.
Why use the Web API
The most important thing about Web APIs is the ability to build services for a variety of clients . In addition to the WCF REST Service, the Web API uses various aspects of the HTTP protocol to express services (such as uri/request response header/caching/versioning/content format). Therefore, many configurations are omitted.
When you encounter these situations, you can consider using the Web API.
Requires a Web service but does not require soap
Need to establish non-soap-based HTTP service on the basis of existing WCF services
Just want to publish some simple HTTP service, do not want to use the relatively complex WCF configuration
The published service may be accessed by a bandwidth-constrained device
Want to use the open source framework, when it is critical to debug or customize the framework
Feature Introduction
Key features of the Web API
Web API vs MVC
Tell them the difference in detail.
MVC is primarily used to build web sites that care about data as well as page presentation, while Web APIs focus only on data
The WEB API supports format negotiation, and clients can notify the server of the desired format via the Accept header
Web API Support Self HOST,MVC not currently supported
The Web API expresses different actions (CRUD) through different HTTP verb, and MVC expresses the action by the action name
The Web API is built into the ASP. Net System.Web.Http namespace, MVC is located under the System.Web.Mvc namespace, so features such as model binding/filter/routing are different
Finally, the Web API is ideal for building mobile client Services
WEB API Learning--web API strong Getting Started Guide