title: Full HTTP Request from cURL in PHP
body: <p>I'm trying to upload an image to a site via their API by trying to mimic a web form and posting the data using cURL. I'm looking to check what cURL is actually sending to the destination site, to ensure I've built the request correctly. I see you can use CURLOPT_VERBOSE to see what it's sending in the request header, but I'm looking to see the posted data, after</p>
  
  <pre><code>Content-Type: multipart/form-data; boundary=----------------------------91f22eea64e8
  </code></pre>
  
  <p>The data I'm posting is in $post and the request is</p>
  
  <pre><code>        $ch = curl_init();
          $opts = array(
              CURLOPT_POST =&gt; 1,
              CURLOPT_CONNECTTIMEOUT =&gt; 10,
              CURLOPT_RETURNTRANSFER =&gt; true,
              CURLOPT_TIMEOUT =&gt; 60,
              CURLOPT_USERAGENT =&gt; 'Mozilla/4.0 (compatible;)',
              CURLOPT_POSTFIELDS =&gt; $post,
              CURLOPT_URL =&gt; 'https://example.com/api',
              CURLOPT_HTTPHEADER =&gt; array('Expect:'),
              CURLOPT_VERBOSE =&gt; 1
          );
          curl_setopt_array($ch, $opts);
          $response = curl_exec($ch);
  </code></pre>
  
  <p>Thanks</p>