Posts

Showing posts with the label Asp.Net Web API

The Web API Request's Journey

Image
ASP.Net Web API Flow ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework. So HTTP is not just for serving up web pages. It is also a powerful platform for building APIs that expose services and data. Hosting Web API Web API can be hosted either on ASP.NET or you could write a Console App or a Windows Service yourself to self-host. Web API’s flexibility starts right at the core as to where it can be hosted. ·          ASP.NET Hosting : When hosted on ASP.NET, the lifecycle starts with the HttpControllerHandler which is an implementation of IHttpAsyncHandler and is responsible for passing requests into the HttpServer pipeline. ·          Self Hosting : When you are Self Hosting, the HttpServer pipel...

Difference between Asp.Net Web API and Asp.Net MVC

Following are some points in difference between Web API and MVC . 1.       Asp.Net MVC is used to create a web application that returns both views and data but Asp.Net Web API is used to create full blown HTTP services with easy and simple way that returns only data. 2.       Web API helps to build REST-ful services over the .NET Framework and it also support content-negotiation(it's about deciding the best response format data that could be acceptable by the client. it could be JSON,XML,ATOM or other formatted data), self hosting which are not in MVC. 3.       Web API also takes care of returning data in particular format like JSON,XML or any other based upon the Accept header in the request. MVC only return data in JSON format using JsonResult. 4.       In Web API the request are mapped to the actions based on HTTP verbs but in MVC it is mapped to actions name. ...