title: Curl post with JSON data fails
body: <p>I'm trying to use a heredoc to pass in the ONE param I need to make a POST request via curl, this is the error I run into</p>
  
  <pre><code>./scripts/etcd.sh: line 10: warning: here-document at line 10 delimited by end-of-file (wanted `EOF{peerURLs:[http://etcd-$ordinal:2380]}EOF')
  ./scripts/etcd.sh: line 9: warning: here-document at line 9 delimited by end-of-file (wanted `EOF{peerURLs:[http://etcd-$ordinal:2380]}EOF')
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  100    42  100    42    0     0  12639      0 --:--:-- --:--:-- --:--:-- 21000
  {"message":"unexpected end of JSON input"}
  </code></pre>
  
  <p>And the 2 lines in the script that trigger it</p>
  
  <pre><code>request_body=$(cat &lt;&lt;EOF{\"peerURLs\":[\"http://etcd-$ordinal:2380\"]}EOF); 
  curl http://etcd-0.etcd:2379/v2/members -XPOST -H \"Content-Type: application/json\" --data \"$request_body\";
  </code></pre>
  
  <p>I've tried all the answers here <a href="https://stackoverflow.com/questions/17029902/using-curl-post-with-variables-defined-in-bash-script-functions/17032673#17032673">Using curl POST with variables defined in bash script functions</a> before asking my own question.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>From the answers and comments below I've tried</p>
  
  <pre><code>curl http://etcd-0.etcd:2379/v2/members -XPOST -H \"Content-Type: application/json\" --data @&lt;(cat &lt;&lt;EOF\n{\"peerURLs\":[\"http://etcd-$ordinal:2380\"]}\nEOF)
  </code></pre>
  
  <p>And it works, but with giving a similar error</p>
  
  <pre><code>./scripts/etcd.sh: line 12: warning: here-document at line 10 delimited by end-of-file (wanted `EOF')
  ./scripts/etcd.sh: line 12: warning: here-document at line 10 delimited by end-of-file (wanted `EOF')
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  {"id":"a473da4d8f77b2b0","name":"","peerURLs":["http://etcd-3.etcd:2380"],"clientURLs":[]}
  </code></pre>