0
0
PostmanHow-ToBeginner ยท 3 min read

How to Send Path Parameters in Postman: Step-by-Step Guide

In Postman, you send path parameters by including them directly in the URL using curly braces like {parameterName}. Define the parameter values in the Params tab or as environment variables, and Postman replaces them when sending the request.
๐Ÿ“

Syntax

Path parameters are placeholders in the URL enclosed in curly braces {}. You write the URL with these placeholders, then provide actual values separately.

  • URL pattern: https://api.example.com/users/{userId}/posts/{postId}
  • Parameter names: userId and postId are keys you replace with real values.
  • Value assignment: You assign values in Postman's Params tab or environment variables.
http
https://api.example.com/users/{userId}/posts/{postId}
๐Ÿ’ป

Example

This example shows how to send a GET request with path parameters userId and postId in Postman.

http
GET https://api.example.com/users/{userId}/posts/{postId}

// In Postman Params tab:
// Key: userId, Value: 123
// Key: postId, Value: 456
Output
Request URL sent: https://api.example.com/users/123/posts/456 Response: 200 OK with user 123's post 456 data
โš ๏ธ

Common Pitfalls

Common mistakes when sending path parameters in Postman include:

  • Not using curly braces {} around parameter names in the URL.
  • Forgetting to define parameter values in the Params tab or environment variables.
  • Mixing path parameters with query parameters incorrectly.
  • Using incorrect parameter names that don't match the API specification.

Always double-check the API docs for exact parameter names and ensure values are set before sending the request.

http
Wrong URL:
GET https://api.example.com/users/userId/posts/postId

Right URL:
GET https://api.example.com/users/{userId}/posts/{postId}

// Then set values in Params tab
๐Ÿ“Š

Quick Reference

StepActionNotes
1Write URL with {paramName}Use curly braces for each path parameter
2Open Params tab in PostmanAdd keys matching param names
3Enter values for each parameterValues replace placeholders in URL
4Send requestPostman sends URL with parameters replaced
โœ…

Key Takeaways

Use curly braces {} in the URL to mark path parameters in Postman.
Set parameter values in the Params tab or environment variables before sending.
Check API docs for exact parameter names to avoid errors.
Do not confuse path parameters with query parameters.
Always verify the final request URL in Postman before sending.