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
Content-Type: multipart/form-data; boundary=----------------------------91f22eea64e8
The data I'm posting is in $post and the request is
$ch = curl_init();
$opts = array(
CURLOPT_POST => 1,
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible;)',
CURLOPT_POSTFIELDS => $post,
CURLOPT_URL => 'https://example.com/api',
CURLOPT_HTTPHEADER => array('Expect:'),
CURLOPT_VERBOSE => 1
);
curl_setopt_array($ch, $opts);
$response = curl_exec($ch);
Thanks