Runner changes headers and does not inject some environment variables

Ethan
Wed, 02 Sep 2020 20:07:06 +0000
Help Hub

Hi, I’m new to using Runners in Postman, and am getting some unexpected behavior.

Currently I have a request to get an access_token from an API. The call runs as expected when pressing the ‘Send’ button but does not work when making the same call using the runner. The call is set up like this:

GET - https://website/{{tenant_id}}/oauth2/v2.0/token

There are the standard headers and additionally-
Content-Type: application/x-www-form-urlencoded

Body is marked as x-www-form-urlencoded and includes a couple of environment variables like-
client_id: {{client_id}}
client_secret: {{client_secret}}

As said before - this all works as intended when running using the ‘Send’ button. However, when I run the exact same request using the runner it fails. When I looked at the saved request it was sent with the {{tenant_id}} injected properly in the URL but the request body was marked as application/json and looked like this:

{
    "client_id" : "{{clientId}}",
    "client_secret" : "{{clientSecret}}",
}

where the variables weren’t injected. Strangely, my environment variables are in the format client_id and client_secret not clientId and clientSecret, and are coded properly this way when viewing/editing my request.

Is this a bug? Is there something I’m missing?

Thanks all!

2 posts - 2 participants