title: CURL variables and problems parsing JSON
body: <p>My script is creating pull requests using the github API:</p>
  <p><code>./my-script.sh my-repo my-branch</code></p>
  <pre class="lang-sh prettyprint-override"><code>#!/bin/bash
  
  Repo=$1
  Branch=$2
  
  cd $Repo
   
  get_data() {
  cat &lt;&lt;EOF
      {
          &quot;title&quot;: &quot;PR title&quot;,
          &quot;head&quot;: $Branch,
          &quot;base&quot;: &quot;development&quot;,
          &quot;body&quot;: &quot;PR description&quot;
      }
  EOF
  }
  
  echo $(get_data) # &lt;----------------- I can see my value of the variable $Branch here
  
  curl -X POST \
      -H &quot;Accept: application/vnd.github.v3+json&quot; \
      -d &quot;$(get_data)&quot; \ # &lt;----------------- But here I'm facing &quot;Problems parsing JSON&quot;
      -u my_user:my_token \
      https://api.github.com/repos/my_user/$Repo/pulls
  
  open https://github.com/my_user/$Repo/pulls
  </code></pre>
  <p>How can I set my variable into the curl correctly?</p>