Using variables in body with RAW/Text

Hi *,
I’ve searched but could not find anything that solves my problem.

I’m trying to use variables in the body of a POST request. I’ve tried to use “{{variable}}”, but it does not work.

I think the problem is the ‘content-type’ we are using for this internal end point is a custom.

If is use data instead of variables, the request works correctly. However when I add the variables, the request fails.

How do I use variables if the body is set to Raw/text?

Hi @abalagta, welcome to the community! :wave:

I guess there’s some other issue with the script / the variables not being set properly, because irrespective of the type of request body, the variables will always get resolved.

As you can see above, I have a request body with “text” selected as type.

And as you can see above, the variable t has been correctly resolved.

To debug further, you can check the outgoing request using the Postman Console.

Also, I’d recommend that you update to the latest version of the native app - v7.5.0 (as of writing this post).

1 Like