I have several variables, not literals, that I want include in a json string. This doesn't work:
a1 = get_email
a2 = get_user_name
json1 = '{"email": a1, "username": a2}'
because the variables aren't evaluated.
And doing this the other way around will make json invalid because single quotation marks aren't allowed in json:
a1 = get_email
a2 = get_user_name
json1 = "{'email': a1, 'username': a2}"
How can I create a json with those variables?