I'm using a 3rd party PHP class to access an API, it has got the following code:
$fh = fopen('php://memory', 'w+');
fwrite($fh, $xml);
rewind($fh);
$ch = curl_init($req->to_url() );
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_PUT, true);
curl_setopt($ch, CURLOPT_INFILE, $fh);
On the last line, i.e this one:
curl_setopt($ch, CURLOPT_INFILE, $fh);
I'm getting the error:
Warning: curl_setopt() [function.curl-setopt]: cannot represent a stream of type MEMORY as a STDIO FILE*
What am I doing wrong?