title: bash curl POST request: "-d" option using a variable
body: <p>I am trying to make a POST request. The following works without any problem;</p>
  
  <pre><code># Get expected response
  curl http://localhost:9020/xxx/xxxx/ -H Content-type:application/json 
  -H Accept:application/json -d '{"LED":{ 
  "language":"CHINESE"}, "text":"1928年11月22日"}'
  </code></pre>
  
  <p>However, if I try and set the value for the <code>-d</code> option curl cannot submit the request to the server.</p>
  
  <pre><code>var="{\"LED\":{ \"language\":\"CHINESE\"}, \"text\":\"1928年11月22日\"}"
  # No Response
  curl http://localhost:9020/xxx/xxxx/ -H Content-type:application/json 
  -H Accept:application/json -d $var
  </code></pre>
  
  <p>Can anyone explain why the latter does not seem to work? I have tried a variety of escape characters, but no luck with that either.</p>