Hi, I’m trying to set my env to store jwt token, and no matter what I tried I can’t see it working, no value in Env section. I typed this code in `cripts` section, tried for local/global:
Made brand new env, and have the same result, in this case Script section is empty for both Pre and Post-Response.Post works fine, status =200, see jwt generated. Maybe I can just ignore this message on console?
In the image, did you manually change that to Raw or was it returned like that?
It looks like it’s returning that as a string, that looks like JSON. It might be a request/response header missing somewhere though. It would be throwing that error because it’s trying to parse that string as JSON in the pm.response.json() method.
You can use pm.response.text() but you would then need to add some additional logic to extract the value you need. I would personally look closer at the headers first.
I might changed output to RAW to troubleshoot in first pic, here is what I have by default = JSON, it’s look OK for both. I’m sure it’s Json, b’z it worked OK with variable a month ago.
IT’s same error, original content-type worked fine still. Overall I don’t have any issues with this API running it in python, just trying to do some automation in Postman.
“error”: “invalid_request”,