0

How do you use string formatting on a json string or other strings that have brackets? This, you would work with as a dictionary, but I can't think of a good example:

payload = '''
{"accessToken": "{accessToken}","clientToken": "{clientToken}"}
'''.format(clientToken = clientToken, accessToken = accessToken)
martineau
  • 112,593
  • 23
  • 157
  • 280
JadeSpy
  • 126
  • 1
  • 8
  • Does this answer your question? [How to use python str.format inside a string of json format](https://stackoverflow.com/questions/39948645/how-to-use-python-str-format-inside-a-string-of-json-format) – Abhigyan Jaiswal Jan 23 '21 at 01:29
  • Yes it does. Thank you very much. – JadeSpy Jan 23 '21 at 02:39

0 Answers0