question

Upvotes
Accepted
3 0 0 2

Postman how to get request body with already substituted variables

Hi,

could you help me with one thing

I need to save request body (json with variables) to use it later in my prerequest script. Unfortunately when I display request data

console.log(request.data);

It looks for example like this:

{

"session": "{ {session}}",

"playerid": "{ {playerid}}",

"currency": "{ {currencyCode}}",

"action":

{ "command": "com",

"parameters": {

"country": "{ {countryCode}}"

} } }

Is there a possibility to get request body in Pre-req. with already substituted variables?

tick-history-rest-apipostman
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
13.7k 27 8 12
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
3 0 0 2

Working great, thank you!

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.