ASP. NET Web API features

Source: Internet
Author: User

1. Advanced HTTP programming Model: Use the new strongly typed HTTP object model to manipulate HTTP requests and responses directly, using the same programming model and HTTP pipelines on HTTP clients;


2. Support Routing: The Web API fully supports ASP. NET routing, including routing parameters and Constraints. In addition, to the Mapping Support Convention of the action, it is no longer necessary to add properties like [HttpPost] to the class or method;


3, Content negotiation: the client and the server can together determine the format of the API return data. By default, XML, JSON, and form url-encoded formats can be extended to add custom formats, and can even replace the default content negotiation policy;


4. Model Binding and Validation: model Binders can easily extract data from HTTP requests and convert them into. Net objects used in action methods.


5. Filter: The Web API supports filtering, including the well-known [authorize] filtering tag, which allows you to add and insert custom filters for the Action, enabling authentication, exception handling, etc.


6, Query aggregation: as long as the simple return iqueryable<t>, the Web API will support through the OData address contract query;


7. Improved Http details Testability: Instead of setting the HTTP details to a static Context object, the Web API uses Httprequestmessage and Httpresponsemessage instances to add custom types to these HTTP types using the generic versions of these objects ;


8. Improved dependency reversal (IoC) Support: The Web API uses the MVC Dependency Resolver implementation of the service locator pattern to get instances in different scenarios;


9. Code-based configuration: The Web API is configured separately using code to ensure the cleanliness of the configuration files;


10. Self-hosting (self-host): The Web API, in addition to being hosted in IIS, can be hosted in a process and can still use routing and other features.


11. Support for CRUD (create, retrieve, update, delete) operations based on HTTP verb (GET, POST, PUT, delete)

The different meanings are expressed by different HTTP actions, so there is no need to expose multiple APIs to support these basic operations.


12. The requested return format supports Json,xml and can be extended to add additional formats.


13. Native support OData.


14, support Self-host or IIS host.


15, support most MVC function, for example routing/controller/action Result/filter/model builder/ioc container/dependency Injection.



Reference: What is the ASP. http://www.studyofnet.com/news/845.html

This article is from the "Learning also leisure" blog, please be sure to keep this source http://studyofnet.blog.51cto.com/8142094/1680776

ASP. NET Web API features

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.