1

I want to define a custom static url for my connections in Postman:

enter image description here

Then I tried calling a GET request by that custom static url:

enter image description here

But I get Could not send request message because the variable is not defined somehow:

enter image description here

But I don't know why it can not be found since I have defined at Variables section of the Collection and called it like this:

{{staticUrl}}/api/users?page=2

So what's going wrong here? I would really appreciate if you share any idea about this with me...

Pouya
  • 117
  • 1
  • 14

1 Answers1

1

Make sure you save your collection and then move to the actual request tab. I forgot to do the same and Postman cannot resolve the variable.

Also make sure not to press enter button after creating your variable name. It causes Postman to register carriage return symbol ⏎ and thus creates a key with an additional character.

  • No I have checked this multiple times and it is properly saved.. seems weird! – Pouya Aug 31 '22 at 18:56
  • 1
    Found you issue, you have pressed enter after your variable causing Postman to register carriage return symbol ⏎. Remove it, save at the collection tab and then retry. I will update the answer please make sure to upvote it and accept it. Cheers! – Ashutosh Vaish Aug 31 '22 at 18:59