My question:
I have a standard login that returns :
{
"success": true,
"message": "Welcome, noob ;)",
"error": false,
"reason": false,
"data": {
"token": "eyJ0..."
}
}
*Details (like screenshots)*:
*How I found the problem*:
I tried creating an environment and a variable bearer_token. I also tried creating a variable at the top level collection called bearer_token. I have all the Auth pulldown menus set to "Inherit from parent"
*I've already tried*:
1. Wouldn't it make sense to be able to have the login/ API feed the top level or environment bearer token variable directly?
2. Does the environment variable take precedence over the Collection variable, or vice versa?
3. Should I define the authorization at the collection level in terms of a variable also defined at the same level, or do I need the variable to be at a higher level of scope?
4. If I must write a script, it makes sense to me to extract the data->token from the login/ and store it into the variable. This requires a "post-request" script correct ? Why does Postman UI only offer Pre-request scripts ?
Many thanks