REST stands for REpresentational State Transfer coined by Roy Thomas Fielding who is credited for developing HTTP.
REST makes best use of HTTP (Hyper Text Transfer Protocol).
Thus, RESTful webservices try to define services using the different concepts that are already present in HTTP.
HTTP methods are used to indicate what action we are using.
- GET -> to get details of a resource
- POST -> during creation of a resource
- PUT -> update resource
- DELETE -> delete resource
The most important abstraction in REST is called resource.
- A resource is anything that you would want to expose to the outside world through your application
- A resource can have different representations
A resource has an URI (Uniform Resource Identifier)
Create employee -> POST /Employee Delete an employee -> DELETE/Employee/1 Get all employees -> GET /Employees Get Particular employee -> GET /Employee/2
The important thing about REST is the fact that
- We have to think in terms of resources
- Make proper use of HTTP methods
- In REST we don’t have any restriction on Data exchange format.However,JSON is very popular and widely used.
Also note that , transport protocol is always HTTP.
REST is built on top of HTTP.
There is no standard service definition attached with REST.
However the service details can be provided by WADL (Web application definition language) / Swagger
To Summarise the above
Next,we will wrap up the basics by seeing the difference between REST and SOAP