REST WebAPI
API:- API means a software code that helps two different software’s to communicate and exchange data with each other.
WebAPI:-
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.
Asp.NET WebAPI:- 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.
The term API stands for ‘Application
Programming Interface’. ASP.NET Web API is a framework for building Web API’s,
i.e. HTTP based services on top of the .NET Framework. The most common use case
for using Web API is for building RESTful services. These services can then be
consumed by a broad range of clients like
1. Browsers
2. Mobile applications
3. Desktop applications
4. IOTs
What are IOTs
The term IOTs stands for
Internet Of Things. Internet Of Things are the objects or devices that have an
IP address and can communicate over the internet with other internet enabled
devices and objects. Examples for IoT include security systems, electronic
appliances, thermostats, cars etc..., in addition to desktops, laptops, and
smart phones.
One important thing to keep
in mind is that, though ASP.NET Web API framework is widely used to create
RESTful services, it can also be used to create services that are not RESTful.
In short, ASP.NET Web API framework does not dictate any specific architeture
style for creating services. In this video, we will discuss creating RESTful
services from scratch using ASP.NET Web API framework.
Restful WebAPI :- A REST API (also known as RESTful API) is an application programming
interface (API or web API) that conforms to the constraints of REST
architectural style and allows for interaction with RESTful web services. REST
stands for representational state transfer and was created by computer
scientist Roy Fielding.
HttpRequest:-
C
-> Create -> POST -> StatusCode -> return 201
(CREATED)
R
-> Read -> GET -> StatusCode -> return 200
(OK)
U
-> Update -> PUT -> StatusCode -> return 200 (OK)
D
-> Delete -> DELETE -> StatusCode
-> return 204 (NO CONTENT)
StatusCode -> return 400 (BadRequest)
StatusCode -> return 401 (Unauthorized)
StatusCode -> return 404 (NotFound)
StatusCode -> return 500 (InternalServerError)
StatusCode -> return 501 (NotImplemented)
StatusCode -> return 503 (ServiceUnavalialble)