I have this request link with different variable. Some set of parameters will require variable “camera”, but sometime, variable “camera” is not required.
The above example is that i dont need the variable “camera”, if the variable “camera” is removed, it will return 200.
Is it possible to remove the “camera” in request link based on some condition for example, if camera=“”, then the request link will become …/project_id=[440]&sensor_id=[1134,1135,1136,1137]&merge_id=&dashboardURL=&dashboard_title=&start=2022-07-25%2000:00:00&end=2022-07-26%2000:00:00
instead of
…/project_id=[440]&sensor_id=[1134,1135,1136,1137]&merge_id=&dashboardURL=&dashboard_title=&start=2022-07-25%2000:00:00&end=2022-07-26%2000:00:00&camera=
i found out that pm.request.url.query.remove() can acutally do this.
However i do not know to how to access Path Variable’s “description” in the pre-request script…
pm.request.url.query.all() only return key-value but not “description”.
The reason i am doing this is because i want to know if the parameters is required or not