ASP.NET Web API

ASP.NET Web API is a framework for building HTTP services that can be accessed from any client including browsers and mobile devices. It is an ideal platform for building RESTful applications on the .NET Framework.
Web API as the name suggests, is an API over the web which can be accessed using HTTP protocol. It is a concept and not a technology


Characteristics:

  • ASP.NET Web API is an ideal platform for building RESTful services.
  • ASP.NET Web API is built on top of ASP.NET and supports ASP.NET request/response pipeline
  • ASP.NET Web API maps HTTP verbs to method names.
  • ASP.NET Web API supports different formats of response data. Built-in support for JSON, XML, BSON format.
  • ASP.NET Web API can be hosted in IIS, Self-hosted or other web server that supports .NET 4.0+.
  • ASP.NET Web API framework includes new HttpClient to communicate with Web API server. HttpClient can be used in ASP.MVC server side, 
  • Windows Form application, Console application or other apps.



When to choose WCF?

  1. Choose WCF if you use .NET Framework 3.5. Web API does not support .NET 3.5 or below.
  2. Choose WCF if your service needs to support multiple protocols such as HTTP, TCP, Named pipe.
  3. Choose WCF if you want to build service with WS-* standards like Reliable Messaging, Transactions, Message Security.
  4. Choose WCF if you want to use Request-Reply, One Way, and Duplex message exchange patterns.


When to choose ASP.NET Web API?

  1. Choose Web API if you are using .NET framework 4.0 or above.
  2. Choose Web API if you want to build a service that supports only HTTP protocol.
  3. Choose Web API to build RESTful HTTP based services.
  4. Choose Web API if you are familiar with ASP.NET MVC

Comments

Popular posts from this blog

Email Sending through O365 using OAuth Protocol

IISRESET vs App Pool Recycling ?

Deploy .Net6.0 Web api with docker