Class 12 POSTMAN Paramter
Class 12 POSTMAN Paramter
1. Path parameter: used to set the resource path / End point, then we can execute API request with different values
2. Query parameter: used to set the query string, then we can execute API request with different filter criteria.
3. form Parameter : used to set the request body in the from key & value pair
Path parameter: it is used to set the recourse path or end point in the URI. Using path
parameter, we can execute same API with different parameter/values.
Advantages: without changing the URI, we can execute same API request with different data
EG 2 :
https://api.github.com/search/repositories?q=DeepakHR&sort=updated
https://api.github.com/search/users/?q=qs;pidersseleniumoar
After Path Parameter
EG : https://api.github.com/search/:pathPram?q=DeepakHR&sort=updated
Query parameter: It always in the form of key value pair followed by ‘?’. It is always present
at the end of the URL. It’s used to search & filter the recourse via API
EG 1 :
https://api.github.com/users/qspidersseleniumoar/repos?sort=created
: its should list all the repository based on creation
https://api.github.com/users/qspidersseleniumoar/repos?sort=fullname
: its should list all the repository based on alphabetical order
EG : https://api.github.com/search/users
QueryParam1 = DeepakHR
sort = updated
In below Example , We can see the API where we can have both Path Parameter & Query
Parameter
Form Parameter: to pass completer request body in the form of form parameter , & form
parameter will be always set in the form key & value pairs