Introduction of REST Service | Angular | ASP.NET Tutorials

For Consultation : +91 9887575540

Stay Connected :

Introduction of REST Services

  1. We can define Representational State Transfer (REST) as an architectural style that sits on top of a series of principles.
  2. 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.

webapi tutorials in asp.net

web applications offer to extend their functionalities through web api.

The principles of REST are Uniform Interface, Stateless, Cacheable, Client-Server, Layered System, and Code on Demand.

  1. Uniform Interface
    • We can request the resource (the “things” that we want to manage using the API) with the URI. A resource may be a document, database table , pictures etc.
    • we obtain is a representation of that requested resource in a particular format like XML, JSON, PNG, HTML etc.
  2. State Less
  • Statelessness is a fundamental principle for a REST application; the server should never store information about the clients.
  • Stateless also means that the server should never use sessions or other mechanisms to store client information, and every request is not correlated with past or future requests.
  1. Cachable
  • The client can cache the resource, If we manage the cache correctly, we can save several trips to the server.
  1. Client Server
  • What the client sees is the URI and the representation of the resource—that’s all. The client can’t see (and surely isn’t interested in seeing) where the resource is stored.
  1. Layered System
  • The client knows very little about the server; it doesn’t know, for example, if it is directly connected to the server or if it arrived at the server by passing through a proxy or other intermediary server (balancer, etc.).
  1. Code on Demand
  • The server can extend the functionality of the client by passing executable code. For example, a server can send JavaScript to the client so that it can do some type of operation on the data.

  • An aspect of REST that contrasts with SOAP (RPC) is that the operation on the resource is based on the HTTP verb used in combination with the URI.
  • These can be used with their semantic meaning, so when we need to read a resource, we can use the GET method, and when we need to delete a resource, we can use a DELETE, and so on.

Table : HTTP verbs and meanings

Verb     URI           Description


GET  /postsGet the post list.


GET/posts/42Get a single post (the one with id 42).
DELETE  /posts/42Delete the post 42.


POST/postsCreate a post.


PUT/posts/42Update the post.


PATCH/post/42Partial update.


OPTIONS/post/42Retrieve the available operation on the resource.
HEAD/post/42Return only the HTTP header.

asp.net core 2.0 with angular online training