How i can set a variable from URL that i request?

Hello ,

I just add API KEY feature on my API, and now i got some problem to test my api key.
To make API KEY i need a url that’s i request , is anyone can explain to me how i can set a variable from my request url ?

Hey @fxatp21,

Welcome to the Postman Community!! :star2:

If you add this command to the Tests tab, it will save the Request URL as a global variable:

pm.globals.set("requestURL", pm.request.url.toString())

I’m unsure about how you’re going to be using the value but at least you know that you can store it somewhere now :slight_smile:


THANK YOU, it’s work!

Now i just need to get and store on variable javascript.

1 Like