我正在尝试像这样使用 PHP CURL 调用 vtiger 网络服务。
$selectQuery = urlencode("SELECT title,firstname,lastname FROM Contacts;");
$curl = curl_init($data['url'].'/webservice.php?operation=query&sessionName='.$this->sessionName.'&query='.$selectQuery);
curl_setopt($curl, CURLOPT_FAILONERROR, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/json'));
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/4.0");
curl_setopt($curl, CURLINFO_HEADER_OUT, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
$query = curl_exec($curl);
//$query = json_decode($query);
print_r($query);
但我得到了错误
error:The requested URL returned error: 406 Not Acceptable
我只是在执行以下网址中提到的所有过程
有人知道相同的解决方案吗?