title: Using variable in subprocess curl
body: <p>I am aware there exists questions answered on this but I wanted to ask as it is different from the rest.</p>
  
  <p>I am trying to send a curl request using subprocess and cannot get a variable to funcion:</p>
  
  <pre><code> config = json.loads(open('/etc/config.json').read())
      endpoint = config["end_point"]
      auth = config["auth_token"]
      config["widgets"]
  
  
  
      #Send using subprocess
      import subprocess
      subprocess.call([
      'curl',
      '-X',
      'POST',
      '-H',
      'Content-Type: application/json',
      '-d',
      '{ "auth_token": **'auth'**, "widget": "329bdbea887ad8e10e4e496f7a60f898", "title": "Something", "items":[{"label": "testR", "value": "$999.99"}, {"label": "testB", "value": "$9,001.00"}] }',
      **'endpoint'**
  </code></pre>
  
  <p>The config file contains the following:</p>
  
  <pre><code>{"end_point":"http://domain.com","auth_token":"e91a0ffe758c19=ed0","widgets":{"host_info":"fd8a63ads499289a312","memory_info":"0bc2c24ds28bc4c507ad","cpu_info":"5assd0dc41dbd73681"}}
  </code></pre>
  
  <p>Neither auth not endpointurl is not working.</p>
  
  <p>Full code is:</p>
  
  <p>import subprocess
  subprocess.call([
      'curl',
      '-X',
      'POST',
      '-H',
      'Content-Type: application/json',
      '-d',
      '{ "auth_token": "e91a0ffe758c194896eb4daed0", "widget": "329bdbea887ad8496f7a60f898", "title": "Something", "items":[{"label": "text2, "value": "$999.99"}, {"label": "text1", "value": "$9,001.00"}] }',
      '<a href="http://domain.com" rel="nofollow">http://domain.com</a>'
      ])</p>
  
  <p>I</p>
  
  <p>Here I am trying to use <strong>auth</strong> variable instead of <strong>"e91a0ffe758c194896eb4daed0"</strong></p>