Zambiorix
Zambiorix

Reputation: 95

convert String to Int in JSON body

Maybe this is obvious, but I can't seem to solve this one:

I want to use one of my environment variables in a POST json body, but as a number. How do I convert the string variable to an int?

Thanks

Gerd

Upvotes: 2

Views: 312

Answers (1)

Micha Mazaheri
Micha Mazaheri

Reputation: 3481

Sadly, you can't do this in JSON mode. So the best way is to convert back to text, and set your environment variable in the text. Also, you probably want to manually set a header Content-Type: application/json.

Upvotes: 1

Related Questions