📜  用于 restapi 的 curl put 方法 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:37.408000             🧑  作者: Mango

代码示例1
$data = array("a" => $a);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($data));

$response = curl_exec($ch);

if (!$response) 
{
    return false;
}