{ "info": { "name": "My Project", "description": "Collection for testing APIs with assertions.", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "fafa", "description": "", "item": [ { "name": "POST Create Data", "description": "", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Message is OK\", function () {", " var jsonData = pm.response.json();", " pm.expect(jsonData.message).to.eql(\"OK\");", "});" ], "type": "text/javascript", "packages": {} } } ], "auth": {}, "request": { "auth": {}, "method": "POST", "body": { "mode": "raw", "raw": "{\n \"name\": \"Test Item\",\n \"value\": \"12345\"\n}" }, "header": [], "url": { "raw": "{{baseUrl}}/api/data", "path": [ "api", "data" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] } }, "response": [ { "name": "Success", "originalRequest": { "method": "POST", "header": [], "url": { "raw": "{{baseUrl}}/api/data", "path": [ "api", "data" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "body": { "mode": "raw", "raw": "{\n \"name\": \"Test Item\",\n \"value\": \"12345\"\n}" } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [], "cookie": [], "body": "" } ], "protocolProfileBehavior": { "strictSSL": false, "followRedirects": true } }, { "name": "GET Data", "description": "", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Message is OK\", function () {", " var jsonData = pm.response.json();", " pm.expect(jsonData.message).to.eql(\"OK\");", "});" ], "type": "text/javascript", "packages": {} } } ], "auth": {}, "request": { "auth": {}, "method": "GET", "body": {}, "header": [], "url": { "raw": "{{baseUrl}}/api/data/1", "path": [ "api", "data", "1" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] } }, "response": [ { "name": "Success", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{baseUrl}}/api/data/1", "path": [ "api", "data", "1" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "body": {} }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [], "cookie": [], "body": "" } ], "protocolProfileBehavior": { "strictSSL": false, "followRedirects": true } }, { "name": "PUT Update Data", "description": "", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Message is OK\", function () {", " var jsonData = pm.response.json();", " pm.expect(jsonData.message).to.eql(\"OK\");", "});" ], "type": "text/javascript", "packages": {} } } ], "auth": {}, "request": { "auth": {}, "method": "PUT", "body": { "mode": "raw", "raw": "{\n \"name\": \"Updated Item\",\n \"value\": \"54321\"\n}" }, "header": [], "url": { "raw": "{{baseUrl}}/api/data/1", "path": [ "api", "data", "1" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] } }, "response": [ { "name": "Success", "originalRequest": { "method": "PUT", "header": [], "url": { "raw": "{{baseUrl}}/api/data/1", "path": [ "api", "data", "1" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "body": { "mode": "raw", "raw": "{\n \"name\": \"Updated Item\",\n \"value\": \"54321\"\n}" } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [], "cookie": [], "body": "" } ], "protocolProfileBehavior": { "strictSSL": false, "followRedirects": true } }, { "name": "DELETE Data", "description": "", "event": [ { "listen": "test", "script": { "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "pm.test(\"Message is OK\", function () {", " var jsonData = pm.response.json();", " pm.expect(jsonData.message).to.eql(\"OK\");", "});" ], "type": "text/javascript", "packages": {} } } ], "auth": {}, "request": { "auth": {}, "method": "DELETE", "body": {}, "header": [], "url": { "raw": "{{baseUrl}}/api/data/1", "path": [ "api", "data", "1" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] } }, "response": [ { "name": "Success", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{baseUrl}}/api/data/1", "path": [ "api", "data", "1" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "body": {} }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [], "cookie": [], "body": "" } ], "protocolProfileBehavior": { "strictSSL": false, "followRedirects": true } } ], "event": [ { "listen": "prerequest", "script": { "exec": [], "type": "text/javascript", "packages": {} } }, { "listen": "test", "script": { "exec": [], "type": "text/javascript", "packages": {} } } ], "auth": {} } ], "variable": [], "event": [], "auth": {} }