Hi, I have to send a request and do not know how to create a pre-request script. The issue is that the payload should be signed in JWT RS256 (Sign with private key), but the token should be sent in the body, so…
I don’t think that there is a straightforward way of doing that (I’m probably wrong though), there going to be a few moving parts and code to get what you need I believe.
We do have a JWT Helper under the Auth tab but as you require this in the request body, I don’t think that’s going to work for you.
I’ve never done it like this so my responses are going to be based on a bit of research and learning as i’m going.
There is this older topic which is bringing an external lib to do some of the heavy lifting:
This is also something similar which was asked and answered by someone who works at Postman so I could ask him to help out here.
A lot of people are mentioned this util lib that could be brought into Postman via a CDN and stored at the global level. I can’t vouch for this though so it’s up to you if that’s something you want to use.