RESTFul services

Udulatharupathi
3 min readMay 15, 2022

What is Rest API?

A REST API (also known as a RESTful API) is an application programming interface (API or web API) that adheres to the REST architectural style’s limitations and allows users to interact with RESTful web services. Roy Fielding, a computer scientist, invented REST, representing representational state transfer.

What is an API?

A set of specifications and protocols for developing and integrating application software is known as an API. It’s frequently referred to as a contract between an information supplier and an information user, defining the content requested from the consumer (the call) and the producer’s requirements (the content chevalier chevalier chevalier chevalier chevalier chevalier chevalier chevalier eval (the response). The API design for weather service, for example, could specify that the user enters a zip code and the producer responds with a two-part response, the first of which is the high temperature and the second of which is the low temperature.
In other words, an API helps you communicate what you want to a computer or system so it can understand and fulfill your request.
Another benefit of using an API is that you don’t have to understand caching details, such as how and where your resource is fetched.

What is REST?

The word REST stands for “REpresentational State Transfer Protocol.” It’s a type of distributed hypermedia system architecture. Because REST is simple to create and consume, it has quickly become the de-facto standard for developing web services on the internet.

REST has guiding principles and limitations, just like other architectural methods. If a service interface is to be called RESTful, these principles must be followed.

In REST services

  • A URI identifies resources.
  • Client and Server communication.
  • Lightweight, Scalable and maintainable.
  • Multiple URIs may refer to the same resource.
  • JSON or XML is used to pass data

RESTful Methods

  1. GET — Fetch a resource
  2. POST — Insert a new resource
  3. PUT — Replace an existing resource
  4. DELETE — Remove a resource

RESTful constraints

  1. Uniform Interface — By applying the principle of generality to the components interface, we can simplify the overall system architecture and improve the visibility of interactions.
  2. Client-Server — SystemA makes an HTTP request to a URL hosted by SystemB, which returns a response.
  3. Stateless — REST is stateless: the client request should contain all the information necessary to respond to a request.
  4. Cacheable — A response should be defined as cacheable or not.
  5. Layered — The requesting client does not need to know whether it’s communicating with the actual server, a proxy, or any other intermediary.
  6. Code on Demand — REST also allows client functionality to extend by downloading and executing code in the form of applets or scripts.

REST API vs API?

APIs are designed to standardize data transmission between online applications. The protocol choice varies depending on the type of API. REST API, on the other hand, is an architectural style for creating online services that communicate via the HTTP protocol. REST API is based on the web’s Client and Server idea. Because the Client and Server are separated, there is more flexibility.

--

--