Open In App

How to pass parameters in Postman requests?

Last Updated : 07 Dec, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Postman is an API(application programming interface) development tool that helps to build, test and modify APIs. It can make various types of HTTP requests(GET, POST, PUT, PATCH), save environments for later use, and convert the API to code for various languages(like JavaScript, and Python). In this article, we will learn how you pass parameters in Postman requests.

Prerequisites:

Steps to Pass Parameters in Postman Requests:

Step 1: After downloading and installing the Postman, open the software. Add a new Collection and give it a name like “GFG”.

Step 2: When you hover, on the name of your collection, 3 dots will appear. Click on those 3 dots, and then click on “Add new request”

z159

Step 3: You can send path and query parameters with your requests using the URL field and the Params tab.

Query parameters are appended to the end of the request URL, following ? and listed in key value pairs. They are separated by & .

Syntax

?id=1

Path parameters form part of the request URL, and are referenced using placeholders preceded by :

Syntax

:id=1

Step 4: To send a query parameter, add it directly to the URL or open Params and enter the name and value. To send a path parameter, enter the parameter name into the URL field, after a colon.

Example 1: Here, we will be passing Query parameters, we will send query parameters in this API like ?id=1 we will call API like:

https://jsonplaceholder.typicode.com/posts/?id=1

Recording-2023-12-02-at-004647

Example 2 Here, we will be passing Path parameters

https://jsonplaceholder.typicode.com/posts/:id

Recording-2023-12-02-at-005852


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads