I need to use a path param and it seems works
Request1 .../:token/some
Now how can I reuse the value provided for :token in Request1 in other request? So that I don't need put same values on every request?
Request2 .../:token/other
How can I store the value of :token in Request1's test codes? I know how to put a value to the environment
pm.environment.set("", "");
I want to know how to access the value of :token path segment.
I found an answer.
Try to print out the pm.request.url which is an array.
Now we can access the path segment with an index.
var token = pm.request.url.path[2];
pm.environment.set("token", token);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With