- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Manually Generating GUID in Postman
We can manually generate GUID in Postman with the help of the steps listed below −
Step1 − Input the endpoint − https://www.tutorialspoint.com/index.htm in the address bar.
Step2 − Add the below script under the Pre-request Script tab −
var u= require('uuid') var ud = u.v4() console.log(ud)
In the above script, require is used in JavaScript for loading a module. Then, the version 4 of the GUID is stored in the variable ud. Finally, the generated GUID is printed in the console.
It must be remembered that we cannot use a variable with name guid within a Pre-request Script in Postman. However, the guid can be used within headers, URL and Environment variables directly.
Step3 − Send the request by clicking the Send button.
Step4 − Open the Postman Console by clicking the View-> Show Postman Console.
Step5 − It shall show the value of the u variable.
The GUID value obtained is − 58f937dd-a474-47f2-a526-4f6804054611.