我正在使用第 3 方 PHP 类来访问 API,它具有以下代码:
$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);
在最后一行,即这一行:
curl_setopt($ch, CURLOPT_INFILE, $fh);
我收到错误:
警告:curl_setopt() [function.curl-setopt]:不能将 MEMORY 类型的流表示为 STDIO 文件*
我究竟做错了什么?