-
Hello I was wondering what is the best practice to implement something like
Either automatically running after each other or manually, both are fine for me. Would setting the ID in environment variable be the way to go? I tried to also understand |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I'd do it like this: Request 1. Execute GET /api/foo/latest, get the bru.setVar('app-foo-latest-id', res.body.id); Request 2. Execute GET /api/foo/ request with the following pre-request script: req.setUrl(req.getUrl() + bru.getVar('app-foo-latest-id')); Collection variables work across different requests in the same collection. |
Beta Was this translation helpful? Give feedback.
-
Hello all, is there a solution to automatically chain two or more calls together? Let's say request Any ideas? |
Beta Was this translation helpful? Give feedback.
I'd do it like this:
Request 1. Execute GET /api/foo/latest, get the
ìd
out of the body and put it to the collection variable in the post-request script:Request 2. Execute GET /api/foo/ request with the following pre-request script:
Collection variables work across different requests in the same collection.