title: Run curl from .sh script with defined Content-Type
body: <p>When I'm trying to run test.sh script I've always receive error from curl:</p>
  
  <pre><code>curl: (6) Couldn't resolve host 'application'
  </code></pre>
  
  <p>test.sh:</p>
  
  <pre><code>#!/bin/sh
  CT="Content-Type:\ application/json"
  
  TEST="curl http://127.0.0.1 -H $CT"
  echo $TEST
  
  RESPONSE=`$TEST`
  echo $RESPONSE
  </code></pre>
  
  <p>But if I just run following command from console everything fine:</p>
  
  <pre><code>curl http://127.0.0.1 -H Content-Type:\ application/json
  </code></pre>
  
  <p>Could you please let me know what is wrong in script, as I understand something is wrong with 'space' escape, but have no idea how to fix it.</p>
  
  <p>Also I've tried following combination, but result the same:</p>
  
  <pre><code>CT="Content-Type: application/json"
  TEST="curl http://127.0.0.1 -H \"$CT\""
  </code></pre>
  
  <p><em>UPD:</em></p>
  
  <p>bash / dash is only available on server. (/bin/sh --> bash)</p>
  
  <pre><code>GNU bash, version 4.2.10(1)-release (x86_64-pc-linux-gnu)
  </code></pre>