Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles by Debomita Bhattacharjee
Page 11 of 59
GUID in Postman
GUID means Global Unique Identifier. It is in the form of a hexa-decima digit which is separated by hyphen. It helps to achieve distinctiveness due to this even if multiple people are creating the GUID simultaneously, the chance of having a duplicate GUID is rare.To generate a random value, using GUID, the format is −{ "name": "{{$guid}}" }On sending a request, it would produce a random value.GUID is a value with 128 bits having a structure defined in RFC4122. The structure of GUID is uncomplicated and simple for generation.The format of a GUID is shown below −xxxxxxxx-xxxx-Axxx-Bxxx-xxxxxxxxxxxxHere, A is ...
Read MorePostman Cheat Sheet
This Postman Cheat Sheet is based on the official documentation page of Postman (which is available in the below link) and from the overall knowledge on Postman −https://learning.postman.com/docs/getting-started/introduction/a. VariablesAll the variables can be set up manually from the GUI of Postman and they have a defined scope. The values of the variables can also be set with the help of scripts written under the Pre-request Script or Tests tab.The variables can be added in the request URL, Headers and Body in the format as {{}}.Usage in request URL −https://{{domain}}about/{{id}} Usage in request Headers(key-value): X-{{key}}:valueUsage in request Body −{"registration_id": "{{Id}}", "firstname": ...
Read MoreHow to use Global Variable in Postman Request?
We can use a Global variable in Postman Request. . We can set, get and clear a Global variable at runtime using the scripts. This is achieved by the pm.* function. The script to use a Global variable can be included either in the Tests or Pre-Request Script tabTo set a Global variable, the script should be −pm.globals.set('', '')To get the value of a Global variable, the script should be −pm.globals.get('')To get the value of the Global variable in the Postman console, the script should be −console.log(pm.globals.get('')To delete a Global variable, the script is −pm.globals.unset('')Let us try to work with ...
Read MoreHow to Add Cookies in Postman?
We can add cookies in Postman. To add a cookie, the below steps need to be followed −Step1 − Navigate to the Params tab below the address bar and then click on Cookies.Step2 − The MANAGE COOKIES window shall open. It lists down all the current cookies. To add a cookie, click on the Add Cookie button. An edit box with pre-populated values of the cookie are displayed. We can update the value and Save it.Step3 − Send the request to the server.Step4 − After the request has been successfully completed, the Cookies tab in the Response will show the ...
Read MoreGlobal Scope Variables in Postman?
The Global variables are the ones which can be used in every Environments and can be utilized for executing every request. Click on the eye icon available to the top right corner of the Postman application. In the below image, the Global variable g with value value1 is populated under the Globals section.Let us select another Environment – Environment_Test from the No Environment dropdown. Then again click on the eye icon. The Global variable g with value value1 should also be available for this Environment.Now, enter {{g}} in the address bar (with the Environment pointing to Environment_Test) and hover mouse ...
Read MoreWhat are Snippets in Postman?
Snippets are small scripts used in Postman which are used to verify an API. These are pre-developed scripts that can be utilized directly. Thus it helps to save a good amount of time.Snippets can be used in the Pre-request Script and Tests tabs in Postman. Navigate to the Tests tab and the SNIPPETS section should be available to the extreme right of the screen. Click on any snippet to use it in a script.On clicking the link Get a variable, the below script gets populated in the Tests tab which can be used in our own script −pm.variables.get("variable_key");Navigate to the ...
Read MoreHow to see request logs in Postman console?
We can see request logs in the Postman console. Once a request has been sent, the Postman console records the header of request, variables, Response header and body, certificates, proxy settings, errors, scripts, output obtained from console.log, and so on.The Console is obtained from the Postman application by following the navigation − View menu Show Postman Console. Or using the shortcut Ctrl+Alt+C.Let us send a GET request for an endpoint. Add a Pre-request and Tests scripts.Pre-Request Scriptconsole.log("Tutorialspoint - Postman")Testsconsole.warn("Warning message in console") console.log("Logging message in console") console.info("Info message in console") console.error("Error message in console")Postman Console Output shows the message from ...
Read MoreHow to get the value of environment variable in Postman?
We can get the value of an Environment variable in Postman at runtime with the help of scripts. This is done with the help of the pm.* function. The script to get the Environment variable can be included either in the Tests or Pre-Request Script tabTo get an Environment variable, the script should be −pm.environment.get('')Finally, to get the value of the Environment variable in the Postman console, the script should be −console.log(pm.environment.get(''))Let us try to get the value of the Environment variable tutorial.Step1 − Add the below script to get the value of the Environment variable tutorial and print it ...
Read MoreHow to clear the global variables in Postman?
We can clear the Global variables in Postman at runtime with the help of scripts. This is done with the help of the pm.* function. The script to clear the Global variables can be incorporated either in the Tests or Pre-Request Script tabTo clear the Global variable, the script should be −To clear the Global variable, the script should be −pm.globals.unset('')Let us try to clear the Global variable url.Step1 − Add the below script in the Pre-request Script tab −pm.globals.unset('url')Step2 − Click on Send to execute a request.Step3 − After the Response is received, click on the eye icon to ...
Read MoreHow to create a Global Variable in Postman?
We can create a Global variable in Postman. A Global variable can be utilized in all the Environments and can be applied to all requests. In Postman, if we have the same variable name for the Global and Environment variable, then the preference is given to the Environment variable.To create a Global variable follow the steps listed below −Step1 − Click on the eye symbol appearing right of the No Environment dropdown. Then click on Edit in the Globals section.Step2 − The MANAGE ENVIRONMENTS window comes up. Here, we have added the variable url and set the value as https://www.tutorialspoint.com/index.htm. ...
Read More