title: How can I get the raw curl request from an existing PHP curl handle
body: <p>For example, I have a PHP handle that has been initialized somewhere.</p>
  <pre class="lang-php prettyprint-override"><code>$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'
  ));
  </code></pre>
  <p>And at one point I want to know the executed raw curl request</p>
  <pre class="lang-php prettyprint-override"><code>curl_exec($ch);
  
  // ???
  some_method_to_get_raw_curl_request($ch);
  </code></pre>
  <p>Are there any built in methods that can be used for this? I tried looking in the <a href="https://www.php.net/manual/en/ref.curl.php" rel="nofollow noreferrer">PHP Curl Docs</a> but can't seem to find any. If there is none, are there any other way to do this?</p>