본문 바로가기

Tools/Postman

Query parameters & Path variables

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, separated by & using the following syntax: ?id=1&type=new
  • Path parameters form part of the request URL, and are referenced using placeholders preceded by : as in the following example: /customer/:id

To send a query parameter, add it directly to the URL or open Params and enter the name and value. You can enter your query parameters in either the URL or UI fields and it will update elsewhere.

 

쿼리 파라미터 여러개를 넣어주고 싶으면 & 기호로 연결해주면 됨 

category가 ladders인 값만 보고싶다
invalid parameter를 넣어줬을 때 예시
results=3을 넣어주니 결과값을 3개만 보여줌

Path Variables를 넣어주는 방법은 2가지가 있음

1. VALUE 칸에 넣어주거나

2. URL 주소에 바로 값을 넣어주기

 

Path Variable은 Query Parameters와 달리 ? Sign 없음

toolId가 4643인 값만 보고싶다
Console에서 debugging 할 수 있음
invalid한 tool id를 넣어주니 404 error가 return됨

 

Building requests | Postman Learning Center

Building requests: documentation for Postman, the collaboration platform for API development. Create better APIs—faster.

learning.postman.com

 

'Tools > Postman' 카테고리의 다른 글

HTTP headers  (0) 2022.07.10
API Authentication  (0) 2022.07.10
Troubleshooting Postman errors  (0) 2022.07.05
Using Postman on the web (feat. Cloud/Desktop/Browser Agents)  (0) 2022.07.05
Set as a new variable  (0) 2022.06.16