title: How to read headers from file using cURL?
body: <p>I found <a href="https://stackoverflow.com/q/12661159/1197775">this</a>.</p>
  
  <p>And I wrote this variant:</p>
  
  <pre><code>#!/bin/bash
  while read line ; do
    headers="$headers -H '$line'"
  done &lt; public/headers.txt
  echo $headers
  curl -X PUT \
       $headers \
       -d @'public/example.json' \
       echo.httpkit.com
  </code></pre>
  
  <p>In <code>headers.txt</code> I have:</p>
  
  <pre><code>X-PAYPAL-SECURITY-USERID:123
  X-PAYPAL-SECURITY-PASSWORD:123
  </code></pre>
  
  <p>But when I run <code>./public/curl.sh</code> I am not getting the headers I am sending.</p>
  
  <p>I isolated the issue with an env var:</p>
  
  <pre><code>$ x='-H some:asd'
  $ curl $x echo.httpkit.com
  =&gt; header was NOT present
  $ curl -H 'some:asd' echo.httpkit.com
  =&gt; header was present
  $ curl -H some:asd echo.httpkit.com
  =&gt; header was present
  </code></pre>
  
  <p>How can I correctly insert a variable in the header section?</p>