Hello All,
This is a REST API collection which can be used for testing and for Basic Hands-on.
Documentation can be viewed here: https://documenter.getpostman.com/view/18134482/UVC6hRNg
We have two endpoints.
- /users
- /department
User folder has following:
- GET method fetches the complete data of users
- GET method fetches the data of single user.
- POST method to create a new user with id=11.
- PATCH method to modify the user email.
- PUT method to modify the complete user details.
- DELETE method to delete user at id=11.
- POST method to create a new user with id=11.
Department folder has following:
- GET method to fetch all department details
- PATCH method to modify department name for dpt id=5.
I have used json-server which is used to create demo REST JSON services within a short span of minutes.
Steps to start the json-server:
-
Install npm and json-server:
npm install -g json-server
-
Start json-server:
json-server --watch db.json
NOTE: db.json file will be created in your working project directory and you can modify the content present in there.
3.To create mock data I have used Mockaroo. https://www.mockaroo.com/ Mockaroo is a free test data generator and API mocking tool.
-
Open your browser and navigate to http://localhost:3000/, once your json-server is up and running you will be able to see JSON Server home page and under Resources our endpoint will displayed.
-
Access the endpoint : http://localhost:3000/users
-
Implementation of newman htmlextra report: To install newman htmlextra: npm install -g newman-reporter-htmlextra Export the Post Collection in json format. Open command prompt and navigate to the Postman Collection. Execute the command: newman run Rest_Postman.postman_collection.json -r htmlextra
Thank You
Happy Coding,
Learn,Code and Earn
Stay Safe and Stay Positive :)