Introduction of Web API in C#
In this article we shall discuss about the Web API. Before understanding Web API, let's discuss about API first. An API is some kind of interface which has a set of functions that allow programmers to access specific features or data of an application, operating system or other services.
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. We can build Web API using different technologies such as Java, .NET etc.
Below are main characteristics of Web API:
When you're building APIs on the Web, there are several ways you can build APIs on the Web. These include HTTP/RPC, and what this means is using HTTP in Remote Procedure Call to call into things, like Methods, across the Web.
Web API in C#
The ASP.NET Web API is an extensible framework for building HTTP based services that can be accessed in different applications on different platforms such as web, windows, mobile etc. It works more or less the same way as ASP.NET MVC web application except that it sends data as a response instead of html view. It is like a webservice or WCF service but the exception is that it only supports HTTP protocol .
Summary
To summarize, web api is an ideal platform for building RESTful services and in ASP.NET Web API can be hosted in IIS, Self-hosted or other web server that supports .NET 4.0+. In next article we will learn how to create Web API in C#.
Cheers!