title: How to do a curl command with multiple "-d" elements with writing on one line
body: <p>I am trying to execute a curl command with multiple -d parameters (if that is even possible). Below is the command:</p>
  <pre><code>curl -X POST &quot;localhost:8090/rest/myResource/myEndpoint?user=user01&quot; \
   -d 'agg={
      &quot;comm&quot;: {
          &quot;date_histogram&quot;: {
              &quot;field&quot;: &quot;DERIVED_UNIFIED_TIMESTAMP&quot;,
              &quot;calendar_interval&quot;: &quot;month&quot;
          }
      }
     }&amp;
      q={
      &quot;bool&quot;: {
          &quot;must&quot;: [
              {
                  &quot;terms&quot;: {
                      &quot;COMM_TYPE&quot;: [
                          &quot;call&quot;,
                          &quot;email&quot;,
                          &quot;message&quot;
                      ]
                  }
              }
          ]
      }
  }'
  </code></pre>
  <p>With the above format, the endpoint correctly sees the &quot;agg&quot; param but the &quot;q&quot; is empty.</p>
  <p>If I collapse the -d to a single line it works. However, I don't want to have to do that because the user calling should be able to do it across lines. I would be grateful for any ideas. thanks</p>
  <pre><code>curl -X POST &quot;localhost:8090/rest/myResource/myEndpoint?user=user01&quot; \
   -d 'agg={&quot;comm&quot;: {&quot;date_histogram&quot;: {&quot;field&quot;: &quot;DERIVED_UNIFIED_TIMESTAMP&quot;,&quot;calendar_interval&quot;: &quot;month&quot;}}}&amp;q={   &quot;bool&quot;: { &quot;must&quot;: [{&quot;terms&quot;: {&quot;COMM_TYPE&quot;: [                       &quot;call&quot;,&quot;email&quot;, &quot;message&quot;] } }]}'
  </code></pre>