{"info":{"_postman_id":"6c960bde-f8a3-423d-8d82-01a66dc6b0d5","name":"Web server with node and express","description":"<html><head></head><body><h1 id=\"get-started-here\">🚀 Get started here</h1>\n<p>This template guides you through CRUD operations (GET, POST, PUT, DELETE), variables, and tests.</p>\n<h2 id=\"🔖-how-to-use-this-template\">🔖 <strong>How to use this template</strong></h2>\n<h4 id=\"step-1-send-requests\"><strong>Step 1: Send requests</strong></h4>\n<p>RESTful APIs allow you to perform CRUD operations using the POST, GET, PUT, and DELETE HTTP methods.</p>\n<p>This collection contains each of these <a href=\"https://learning.postman.com/docs/sending-requests/requests/\">request</a> types. Open each request and click \"Send\" to see what happens.</p>\n<h4 id=\"step-2-view-responses\"><strong>Step 2: View responses</strong></h4>\n<p>Observe the response tab for status code (200 OK), response time, and size.</p>\n<h4 id=\"step-3-send-new-body-data\"><strong>Step 3: Send new Body data</strong></h4>\n<p>Update or add new data in \"Body\" in the POST request. Typically, Body data is also used in PUT request.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"name\": \"Add your name in the body\",\n    \"age\": number value range from -2^15 to 2^15,\n    \"department\": \"enter your B.tech or Masters stream\"\n}\n\n</code></pre><h4 id=\"step-4-update-the-variable\"><strong>Step 4: Update the variable</strong></h4>\n<p>Variables enable you to store and reuse values in Postman. We have created a <a href=\"https://learning.postman.com/docs/sending-requests/variables/\">variable</a> called <code>base_url</code> which points to <code>http://localhost:3000/v1/</code> assuming the web server is up.</p>\n<h2 id=\"💪-pro-tips\">💪 Pro tips</h2>\n<ul>\n<li><p>Use folders to group related requests and organize the collection.</p>\n</li>\n<li><p>Add more <a href=\"https://learning.postman.com/docs/writing-scripts/intro-to-scripts/\">scripts</a> to verify if the API works as expected and execute workflows.</p>\n</li>\n</ul>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"🚀 Get started here","slug":"get-started-here"}],"owner":"7434942","collectionId":"6c960bde-f8a3-423d-8d82-01a66dc6b0d5","publishedId":"2sA3e5f98m","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-07-14T06:06:58.000Z"},"item":[{"name":"Get all student data","event":[{"listen":"test","script":{"id":"99c76f6c-cafd-4974-82b2-9b26265c7f73","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});"],"type":"text/javascript","packages":{}}}],"id":"334a9571-8e40-42b5-aa99-028d1f3afb0a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/v1/students","description":"<p>This is a GET request and it is used to \"get\" data from an endpoint. There is no request body for a GET request, but you can use query parameters to help specify the resource you want data on (e.g., in this request, we have <code>id=1</code>).</p>\n<p>A successful GET response will have a <code>200 OK</code> status, and should include some kind of response body - for example, HTML web content or JSON data.</p>\n","urlObject":{"host":["http://localhost:3000/v1/students"],"query":[],"variable":[]}},"response":[],"_postman_id":"334a9571-8e40-42b5-aa99-028d1f3afb0a"},{"name":"Get student data by student ID","id":"9b5a2968-5292-4419-a0f4-a985799b9650","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/v1/students/1","description":"<p>get student data by ID.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["v1","students","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"9b5a2968-5292-4419-a0f4-a985799b9650"},{"name":"Add new student data","event":[{"listen":"test","script":{"id":"08371c5e-9819-493e-a332-22c3f0b48fde","exec":["pm.test(\"Successful POST request\", function () {","    pm.expect(pm.response.code).to.be.oneOf([200, 201]);","});",""],"type":"text/javascript","packages":{}}}],"id":"935757c4-c358-44d3-9d51-6e5025270730","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"name\": \"Batman\",\n    \"age\": 40,\n    \"department\": \"MECH\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/v1/students/","description":"<p>This is a POST request, submitting data to an API via the request body. This request submits JSON data, and the data is reflected in the response.</p>\n<p>A successful POST request typically returns a <code>200 OK</code> or <code>201 Created</code> response code.</p>\n","urlObject":{"path":[""],"host":["http://localhost:3000/v1/students"],"query":[],"variable":[]}},"response":[],"_postman_id":"935757c4-c358-44d3-9d51-6e5025270730"},{"name":"Update existing student data","event":[{"listen":"test","script":{"id":"30382e00-7bf1-47d1-921e-9be3afc58294","exec":["pm.test(\"Successful PUT request\", function () {","    pm.expect(pm.response.code).to.be.oneOf([200, 201, 204]);","});",""],"type":"text/javascript","packages":{}}}],"id":"6b962cd8-c712-46f3-8bce-7b51a0b600f1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n\t\"name\": \"Karthik\",\n    \"age\": 26,\n    \"department\": \"EEE\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/v1/students/4","description":"<p>This is a PUT request and it is used to overwrite an existing piece of data. For instance, after you create an entity with a POST request, you may want to modify that later. You can do that using a PUT request. You typically identify the entity being updated by including an identifier in the URL (eg. <code>id=1</code>).</p>\n<p>A successful PUT request typically returns a <code>200 OK</code>, <code>201 Created</code>, or <code>204 No Content</code> response code.</p>\n","urlObject":{"path":["4"],"host":["http://localhost:3000/v1/students"],"query":[],"variable":[]}},"response":[],"_postman_id":"6b962cd8-c712-46f3-8bce-7b51a0b600f1"},{"name":"Delete student data","event":[{"listen":"test","script":{"id":"2e822db8-e247-4283-86c2-b5d045f608b4","exec":["pm.test(\"Successful DELETE request\", function () {","    pm.expect(pm.response.code).to.be.oneOf([200, 202, 204]);","});",""],"type":"text/javascript","packages":{}}}],"id":"a9e6fed0-085a-47bb-8c74-197173919404","request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/v1/students/2","description":"<p>This is a DELETE request, and it is used to delete data that was previously created via a POST request. You typically identify the entity being updated by including an identifier in the URL (eg. <code>id=1</code>).</p>\n<p>A successful DELETE request typically returns a <code>200 OK</code>, <code>202 Accepted</code>, or <code>204 No Content</code> response code.</p>\n","urlObject":{"path":["2"],"host":["http://localhost:3000/v1/students"],"query":[],"variable":[]}},"response":[],"_postman_id":"a9e6fed0-085a-47bb-8c74-197173919404"},{"name":"healthcheck","id":"b5e8871b-b5df-41fd-99d1-244c3da8b4a2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/v1/healthcheck","urlObject":{"host":["http://localhost:3000/v1/healthcheck"],"query":[],"variable":[]}},"response":[],"_postman_id":"b5e8871b-b5df-41fd-99d1-244c3da8b4a2"}],"event":[{"listen":"prerequest","script":{"id":"48bba165-7c99-4d87-8b43-1ce10813ce30","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"e200f71e-b3f4-405d-b5a6-51a6fe829dcf","type":"text/javascript","exec":[""]}}],"variable":[{"key":"id","value":"1"},{"key":"base_url","value":"http://localhost:3000/v1/"}]}