title: How to substitute value for a variable in a json in python?
body: <pre><code>#!/usr/bin/python
  import requests
  import uuid
  
  random_uuid = uuid.uuid4()
  print random_uuid
  url = "http://192.168.54.214:8080/credential-store/domain/_/createCredentials"
  
  payload = '''json={
          "": "0",
          "credentials": {
              "scope": "GLOBAL",
              "id": "random_uuid",
              "username": "testuser3",
              "password": "bar",
              "description": "biz",
              "$class": "com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl"
          }
      }'''
  headers = {
      'content-type': "application/x-www-form-urlencoded",
      }
  
  response = requests.request("POST", url, data=payload, headers=headers)
  
  print(response.text)
  </code></pre>
  
  <p>In the above script, I created a UUID and assigned it to the variable <code>random_uuid</code>. I want the UUID that was created to be substituted inside json for the value <code>random_uuid</code> for the key <code>id</code>. But, the above script is not substituting the value of <code>random_uuid</code> and just using the variable <code>random_uuid</code> itself.</p>
  
  <p>Can anyone please tell me what I'm doing wrong here?</p>
  
  <p>Thanks in advance.</p>