Request parameters
Query parameters help you to filter and request for a specific data from an APÌ endpoint.
You can use query parameters in two ways:
- Append Query parameters at the end of the URL
- Use the "Parameters" tab
Adding parameters in the URL
To add a parameter in the URL, append ? at the end of the URL and add a parameter in key=value format.
You can add multiple parameters by separating them using &.
For example, the below URL is filtered to get the data of the first three pokemon
https://jsonplaceholder.typicode.com/comments?postId=1For which you will get a similar response:
[
{
"postId": 1,
"id": 1,
"name": "id labore ex et quam laborum",
"email": "Eliseo@gardner.biz",
"body": "laudantium enim quasi est quidem magnam voluptate ipsam eos\ntempora quo necessitatibus\ndolor quam autem quasi\nreiciendis et nam sapiente accusantium"
},
{
"postId": 1,
"id": 2,
"name": "quo vero reiciendis velit similique earum",
"email": "Jayne_Kuhic@sydney.com",
"body": "est natus enim nihil est dolore omnis voluptatem numquam\net omnis occaecati quod ullam at\nvoluptatem error expedita pariatur\nnihil sint nostrum voluptatem reiciendis et"
},
...
]Using the Parameters tab
Additionaly, you can add the parameters as a key-value pair in the parameters tab, and these will be appended to the URL automatically when you send the request.
Leveraging AI within PruTAN, you can enhance how you handle request parameters:
AI-Suggested Parameters: AI can suggest common or relevant query parameters based on the endpoint and past usage, saving time and reducing errors.
Automated Parameter Generation: AI can automatically generate and append parameters, ensuring optimal configuration for your requests.
- Try using the parameters tab with AI assistance to see if you get the same response as manually adding parameters in the URL.