{"id":1665,"date":"2021-03-10T00:48:00","date_gmt":"2021-03-10T00:48:00","guid":{"rendered":"https:\/\/www.htmlgoodies.com\/uncategorized\/restful-web-services-in-javascript-supporting-crud-operations\/"},"modified":"2021-08-23T18:47:11","modified_gmt":"2021-08-23T18:47:11","slug":"restful-web-services-in-javascript-supporting-crud-operations","status":"publish","type":"post","link":"https:\/\/www.htmlgoodies.com\/javascript\/restful-web-services-in-javascript-supporting-crud-operations\/","title":{"rendered":"RESTful Web Services – Supporting CRUD Operations"},"content":{"rendered":"

Welcome to part 2 of this series on RESTful Web Services! In part 1<\/a> we set up a basic Web service using Node.js and the Express framework. In this tutorial we’ll learn what makes a service RESTful by adapting our Web server that we built in part 1 to handle different request types.<\/p>\n

REST Service Request Types<\/h2>\n

As mentioned in part 1, REST stands for REpresentational State Transfer. This means there is no state between the client and the server. This is the whole point of using REST – it makes the connection stateless so that any client that utilizes the HTTP protocol can access the data. The client can then iterate through the data and display it anywhere he\/she chooses. Moreover, our server isn’t restricted to browsers only. Native apps and IoT devices can also access the service so long as they implement the HTTP protocol.<\/p>\n

There are a few types of HTTP methods that we need to know before building a REST API. These are the methods that correspond to the CRUD (Create, Read, Update, and Delete) operations:<\/p>\n