What is RESTful API?

What is REST API? 

REST is an abbreviation for Representational State Transfer. It is an way to transfer data's state. 

An API is an interface through which one program or web site talks to another. They are used to share data and services, and they come in many different formats and types. 

In short, a RESTful API is one of the many possible ways that programs, servers and web sites can share data and services. REST describes the general rules for how the data and services are represented through the API so that other programs will be able to correctly request and receive the data and services that an API provides.

RESTful API uses HTTP URI to specify resources, and uses HTTP methods to apply CRUD operations. 

What is URI ?? 

Methods of RESTful API

  • GET : retrieve a resource 
  • POST : create the resource 
  • PUT : change the state of or update a resource
  • DELETE : remove a resource 

RESTful API Design and Architecture Constraint 

  • Use of a uniform interface: Resources should be uniquely identifiable through a single URL, and only by the underlying methods of the network protocol, such as GET, PUT, POST, and DELETE with HTTP. 
  • Client-server based: There should be a clear delineation between server and the client. For example, UI and request gathering concerns are the client's domain. Data access, workload management and security are the server's domain. 
  • Stateless operation: The server should not store data(session, cookie, etc) related to client request. Also, individual requests should be independent from each other.
  • RESTful resource caching: All resources should allow caching unless explicitly indicated that caching is not possible. Caching helps to reduce server loads. 
  • Layered system: REST allows for an architecture composed of multiple layers of servers. 
  • Code on demand: Most of the time, server will send back static representations of resources in the form of XML or JSON. However, when necessary, servers can send executable code to the client. 


REFERENCE 

Comments

Popular posts from this blog

Structures of JAVA

What is URI(URN, URL)

Spring Boot JPA - Pagination

Java Data Structures VS Python, C/C++ Data Structures

Spring Boot JPA - What is JPA, Entity, Repository

Design Pattern - Proxy