RESTful Web Services
What is REST?
REST means the Representational State Transfer Protocol.REST uses widely when creating web services since it is a software architectural style that can be used to define a set of constraints.Using REST we can build web services that are scalable, lightweight and maintainable in nature.
We call these kinds of web services as RESTful Services.
Advantages of RESTful web services
- It allows various data formats such as XML and JSON to pass data which makes the user easier to work with.
- Since REST is capable of controlling a variety of calls it provides huge flexibility to the user.
- It increases the portability, scalability of projects.
- The separation between the user interface and the server also helps to improve the scalability and portability of the development.
- Whenever the developer has to change the testing environment REST helps to stay independent despite the languages or the type of platform.
Disadvantages of RESTful web services
- When you are working with sessions it may be difficult to maintain the state in REST.So at first, it may be a bit difficult to adapt to work with REST.So it is essential to have a proper understanding of the constraints when you are developing with REST.
- Even though the REST is lightweight, we still use SOAP to handle complex environments and it is not suitable to handle a large amount of data.
RESTful key Elements
Below I have listed down the key elements of RESTful Implementation
Resources - This is an object that has several methods operate on it. It also consists of associate data and relationship to other resources.
Request Verbs - Here the verbs are methods like PUT, POST, DELETE etc. These verbs describe what is required to do with the resource.
Request Headers - Request Headers describe what is the response type required. These are sent with the request and contains additional instructions.
Request Body - This contains the information about the resource that needs to pass to the server.
Response Body - This can be introduced as the main body of the Response.
Response Status Code - When the responses are returning from the webserver, these codes are also generally returned with them.
RESTful Methods
POST - Use to create new resources
GET - Use to retrieve a list of resources
PUT - Use to update the resources
DELETE - Use to delete the resources
PATCH - Use to modify resources


Comments
Post a Comment