- Postman - Discussion
- Postman - Useful Resources
- Postman - Quick Guide
- Postman - OAuth 2.0 Authorization
- Postman - Run Collections using Newman
- Postman - Newman Overview
- Postman - Sessions
- Postman - Cookies
- Postman - Mock Server
- Postman - Assertion
- Postman - Collection Runner
- Postman - Parameterize Requests
- Postman - Create Collections
- Postman - Create Tests for CRUD
- Postman - DELETE Requests
- Postman - PUT Requests
- Postman - POST Requests
- Postman - GET Requests
- Postman - Workflows
- Postman - Authorization
- Postman - Environment Variables
- Postman - Environment Setup
- Postman - Introduction
- Postman - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Postman - Parameterize Requests
We can parameterize Postman requests to execute the same request with various sets of data. This is done with the help of variables along with parameters. A parameter is a part of the URL used to pass more information to the server.
The data can be used in the form of a data file or an Environment variable. Parameterization is an important feature of Postman and helps to epminate redundant tests. Parameters are enclosed in double curly braces {{parameter}}.
Example
Let us take an example of an URL −
. We shall create a variable as url then use it for parameterization of request. We can refer to it in the format {{url}} in Postman.A parameter is in the form of a key-value pair. So to point to the URL:
, we can mention it as {{url}}/index.htm. So here, the url is the key and the value set isCreate a Parameter Request
Follow the steps given below to create a parameter request in Postman −
Step 1 − Cpck on the eye icon to the right of the Environment dropdown in the top right corner in the Postman apppcation.
Step 2 − Cpck on the Edit pnk in the Globals section.
Step 3 − MANAGE ENVIRONMENTS pop-up comes up. Enter URL for the VARIABLE field and
for INITIAL VALUE. Then, cpck on Save.Step 4 − Cpck on close to move to the next screen.
Step 5 − In the Http Request tab, enter {{url}}/index.htm in the address bar. Select the GET method and cpck on Send.
Response
Once a request has been sent, we can see the response code 200 OK populated in the Response. This signifies a successful request and a correct endpoint.
Advertisements