CURLOPT_请求字段

CURLOPT_请求字段,curl,Curl,我有以下代码 $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_INTERFACE, "IP_ADDRESS"); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Cache-Control: no-cache', 'Content-Type: application/x-www-

我有以下代码

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_INTERFACE, "IP_ADDRESS");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
                'Cache-Control: no-cache',
                'Content-Type: application/x-www-form-urlencoded'
            ));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_REQUESTFIELDS, http_build_query(array('email' => $email, 'passwd' => $passwd)));
// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec ($ch);
curl_close ($ch);
我发现了错误 警告:使用未定义的常量CURLOPT_REQUESTFIELDS-假定在。。。 警告:curl_setopt()要求参数2为int,字符串以

令人惊讶的是,在不同文件夹中的旧文件上的类似代码正在工作

我发现了错误

它的CURLOPT_POSTFIELDS而不是CURLOPT_REQUESTFIELDS