Replies: 2 comments 1 reply
-
I also have a similar scenario where I have a pre-request script to get the JWT Token and store it in an environment variable. const loginUrl = pm.environment.get("baseUrl") + "login";
pm.sendRequest({
url: loginUrl,
method: 'POST',
header: {
'content-type': 'application/json'
},
body: {
mode: 'raw',
raw: JSON.stringify({"username": "admin",
"password": "password" })
}
}, function (err, res) {
pm.environment.set("auth", res.json().token);
}); |
Beta Was this translation helpful? Give feedback.
-
Thanks for your efforts, Rishabh. I know how these things are done in Postman and I know, how to implement script based access-token handling in Bruno - I have implemented these things by myself. So I also know about the axios ceremony. But this time I really want to run an arbitrary request from my existing collection. It is exactly the feature, that scflode asked for in your quoted thread (#535): "The point of the idea here is if it's possible to have something like bru.run("Request name") basically wrapping the Axios ceremony." Anoop responded: "Yes, We will support this soon." |
Beta Was this translation helpful? Give feedback.
-
Is there an easy way to run a request of your collection via pre- or post-request scripting?
(something like "bru.run("name of request")
I know, that I can run an arbitrary request via bru CLI, but I do not know, how to
run a request from a pre- or post-request script out of an existing request.
(I have to confess: I do have only very little JavaSkript knowledge)
Kind regards
Igel1
Beta Was this translation helpful? Give feedback.
All reactions