Say, you have some data in a database and you want to manipulate it. You do that through one of the CRUD operations. But you need an interface to perform these actions like a command prompt where a CLI (Command Line Interface) is available for that database, or a GUI interface, etc.
Suppose you want to carry out these data manipulations remotely, how do you do it? Again, you either VPN into the machine where you have access to this database and carry out the operations. Or, if you have an online application, you can access on a browser and carry out these operations.
What if you don't have an online application but just got couple of URLs that could help you to manipulate your data thru http protocol from a remote machine?
So you build an application that provides these URLs so that anybody who wants to get the data, insert the data, update the data, or delete the data can use them thru http access. You build one URL that helps user to insert/get/delete the data based on the HTTP request method. This URL is called as a Representational State Transfer Service or a REST Service.
- What is REST stands for?
- REST stands for Representational State Transfer.
- A REST Service is used to manipulate the state of data through HTTP protocol.
- Following is the match between HTTP requests and CRUD actions.
- HTTP request POST - Create
- HTTP request GET - Read
- HTTP request PUT - Update
- HTTP request DELETE - Delete
- So how do you build a REST Service?
- You can build a REST Service in multiple ways some of which include a Spring boot application, a NodeJS application, etc.
- All you got to remember while building a REST service is to obey the HTTP request types. So when a POST REST service is made for example, your application should receive the data and do some create/insert process.
- What is the Spring Boot REST service application architecture looks like?
- There will be a REST Controller that declares the name of the REST service and attaches it to a service java class that would perform the CRUD operations.
- Example sites to build a REST service using NodeJS and also Spring Boot?
No comments:
Post a Comment