Skip to main content

Command Palette

Search for a command to run...

RESTful web services

Published
2 min read
RESTful web services
D

Hello folks ! Myself Deepak . I'm a student and aspiring Blockchain developer.

RESTful web services are services that follow REST architecture. REST stands for Representation State Transfer and uses HTTP protocol (web protocol) for implementation. These services are lightweight, provide maintainability, and scalability, and support communication among multiple applications that are developed using different programming languages. They provide means of accessing resources present at the server required for the client via the web browser by means of request headers, request body, response body, status code, etc.

Features of RESTful Web Services

  • The service is based on the Client-Server model.

  • The services use HTTP Protocol for fetching data/resources, query execution, or any other functions.

  • The medium of communication between the client and server is called "Messaging".

  • Resources are accessible to the service using URIs.

  • It follows the statelessness concept where the client's request and response are not dependent on others and thereby provides total assurance of getting the required data.

  • These services also use the concept of caching to minimize the server calls for the same type of repeated requests.

  • These services can also use SOAP services as implementation protocols for REST architectural patterns.

HTTP Methods

HTTP methods are also known as HTTP Verbs. They form a major portion of uniform interface restriction followed by the REST that specifies what action has to be followed to get the requested resource.

  • GET: This is used for fetching details from the server and is basically a read-only operation.

  • POST: This method is used for the creation of new resources on the server.

  • PUT: This method is used to update the old/existing resource on the server or to replace the resource.

  • DELETE: This method is used to delete the resource on the server.

  • PATCH: This is used for modifying the resource on the server.

  • OPTIONS: This fetches the list of supported options of resources present on the server.

The POST, GET, PUT, and DELETE corresponds to the create, read, update, and delete operations which are most commonly called CRUD operations.

GET, HEAD, OPTIONS are safe idempotent methods whereas PUT and DELETE methods are only idempotent. POST and PATCH methods are neither safe nor idempotent.

Disadvantages of RESTful web services

  • As the services follow the idea of statelessness, it is not possible to maintain sessions(Session simulation responsibility lies on the client side to pass the session id)

  • REST does not impose security restrictions inherently. It inherits the security measures of the protocols implementing it. Hence, care must be chosen to implement security measures like integrating SSL/TSL-based authentications, etc.

More from this blog

Untitled Publication

8 posts

I'm a Student. Currently learning a full-stack development. Exploring Web3 space. Love to learn about new technologies.