title: curl: argument list too long
body: <p>I want to send an email with attached pdf file through the Sparkpost API with curl post.</p>
  
  <p>To insert the pdf I use (my test.pdf is ~ 200KB)</p>
  
  <pre><code>"data":"'$(cat test.pdf} | base64 --wrap=0)'"
  </code></pre>
  
  <p>But somehow this doesn't work out showing the following error:</p>
  
  <pre><code>/usr/bin/curl: Die Argumentliste ist zu lang (original)
  /usr/bin/curl: Argument list is too long
  </code></pre>
  
  <p>EDIT:
  curl command</p>
  
  <pre><code>curl -X POST https://api.eu.sparkpost.com/api/v1/transmissions -H 'Authorization: &lt;APIKEY&gt;' -H 'Content-Type: application/json' -d '{
     "options":{
        "open_tracking":false,
        "click_tracking":false,
        "inline_css":false
     },
     "recipients":[
        {
           "address":{
              "email":"user@domain.tld",
              "name":"user"
           }
        }
     ],
     "content":{
        "from":{
           "name":"sender",
           "email":"sender@domain.tld"
        },
        "reply_to":"replyto@domain.tld",
        "subject":"subject",
        "text":"textbody",
        "attachments":[
           {
              "name":"attachmentname.pdf",
              "type":"application/pdf",
              "data":"'$(cat test.pdf | base64 --wrap=0)'"
           }
        ]
     }
  }'
  </code></pre>