I'm trying to make a curl call that also pass an image file along.
Obviously it's not working for me. However, I've got a test working that just use straight up html form.
How can I debug / print out the raw data that is being passed from curl?
Trying to compare the call with the form version to see what is different.
I've tried these:
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_VERBOSE, true);
print_r(curl_getinfo($curl));
But those seems to just return the response as opposed the raw request. (it's through a 3rd party so I have no access to the end point)
Thank you,
Tee
curl
the command line client has a --trace-ascii
option for that. But that feature is not exposed in the PHP interface.
The _VERBOSE
output might however still contain some information (if it's really a server error). You must redirect it into a separate file however before:
$fp = fopen("curl.log", "w");
curl_setopt($ch, CURLOPT_STDERR, $fp);
Failing that, I'm afraid the best option is to peek at the network traffic (using a separate tool, ad-hoc proxy maybe).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With