PUT与PHP

建立一个PUT接口

发送的HTTP头应该是Content-Type=application/json

parse_str(file_get_contents('php://input'), $data);

请求一个PUT接口

curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'PUT');

curl_setopt($handle, CURLOPT_POSTFIELDS, $data); //设置请求体,提交数据包

原文地址:https://www.cnblogs.com/toumingbai/p/11927116.html