Whats New in ASP.NET Web API 2

ASP.NET Web API provides a quick yet powerful way to built HTTP services that can easily be consumed by a variety of clients. It is simple to get started using and it has a lot of features like filters, formatters, and message handlers that can be used to extend when needed.


Here are some of the best features of ASP.NET Web API 2:

Attribute Routing. Attribute Routing is extremely easy to use and it gets the job done. However, it does not include the default api string on the from of the route you might be used to seeing. It is possible to add “api” in front of the route but then you have to repeat is across attribute-based routes as well.

Returning responses with IHttpActionResult. This new interface which is similar to ActionResult in ASP.NET MVC can be used as the return type for Web API controller actions. To return a custom response, you can use the new helper methods exposed to the ApiController.

Read the rest of the post here: http://weblogs.asp.net/dwahlin/archive/2013/11/11/new-features-in-asp-net-web-api-2-part-i.aspx


Leave a Reply

Your email address will not be published. Required fields are marked *