Test your REST API using Postman

Request Flow
collection level pre-request script editor
Request level pre-request script editor
pm.test("Status code is 200", function () {pm.response.to.have.status(200);});
Use test snippet templates
Pre-requests for the request
Request body with the variables defined in the pre-request scripts
Usage of collection-level pre-requests for authorization
Test script for user creation request

Here is a postman collection for the above request collection: https://app.getpostman.com/run-collection/c1c4bc67be06c55ee9b5

Test result has shown upon request execution
Set Environment
Collection run

Here is the file for above tests: https://gist.githubusercontent.com/AnuradhaSK/9f0fefcff1b8ea047dce61b78e323e5f/raw/f89f4c840416fd59584c8a7f6428d7274d34c30a/collection-run.json



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store