Cli*_*ote 4 php curl filehandle
我正在使用第三方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);
Run Code Online (Sandbox Code Playgroud)
在最后一行,即这一行:
curl_setopt($ch, CURLOPT_INFILE, $fh);
Run Code Online (Sandbox Code Playgroud)
我收到错误:
警告:curl_setopt()[function.curl-setopt]:不能将MEMORY类型的流表示为STDIO FILE*
我究竟做错了什么?