title: Using a bash variable to pass multiple headers to curl command
body: <p>I would like to make <code>curl</code> request with multiple headers.The solution would be to make this command :</p>
  
  <pre><code>curl -H "keyheader: value" -H "2ndkeyheader: 2ndvalue" ...
  </code></pre>
  
  <p>My goal is to use only one variable with all the headers like :</p>
  
  <pre><code>headers='-H "keyheader: value" -H "2ndkeyheader: 2ndvalue" '
  curl $headers
  </code></pre>
  
  <p>to send</p>
  
  <pre><code>curl -H "keyheader: value" -H "2ndkeyheader: 2ndvalue"
  </code></pre>
  
  <p>Currently, the problem is : I can use <code>'</code> or <code>"</code> to declare my string, but <code>bash</code> tries to run what's after <code>"-H"</code> as arguments and then answers : </p>
  
  <pre><code>command unknown
  </code></pre>
  
  <p>Would like to know what is going wrong here.</p>