在提交curl请求后,我得到了响应方法不允许


After submit a curl request I got response Method Not Allowed

Method Not Allowed不允许使用HTTP动词访问此页我想通过curl和get reply Method不允许删除REST API服务器中的数据。为什么我收到这条信息?

注:$url_1 = API PATH

$reqpath = "contacts?expand=".$customer;
                $json ='';
                $url_1 = $path.$reqpath;
                $ch_1=curl_init();
curl_setopt($ch_1, CURLOPT_HTTPHEADER,  array('Content-Type: text/plain'));
                curl_setopt($ch_1,CURLOPT_URL, $url_1);
                curl_setopt($ch_1,CURLOPT_POST,true);
                curl_setopt($ch_1, CURLOPT_CUSTOMREQUEST, "DELETE");
                curl_setopt($ch_1, CURLOPT_POSTFIELDS,$json));
                curl_setopt($ch_1,CURLOPT_RETURNTRANSFER, true);
                $result= curl_exec($ch_1);
                curl_close($ch_1);

服务器配置有问题。看http.request.methods.allowed行下的:http://php.net/manual/en/http.configuration.php。您需要在此配置中添加"DELETE"