0

For example, I have a PHP handle that has been initialized somewhere.

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json'
));

And at one point I want to know the executed raw curl request

curl_exec($ch);

// ???
some_method_to_get_raw_curl_request($ch);

Are there any built in methods that can be used for this? I tried looking in the PHP Curl Docs but can't seem to find any. If there is none, are there any other way to do this?

reikyoushin
  • 1,993
  • 2
  • 24
  • 40

0 Answers0