我尝试按照 Directus 文档更新项目,但我无法更新记录,它总是返回
{“错误”:{“代码”:6,“消息”:“方法不允许”}}
我的 PHP 代码是:
$url = 'https://cms.domain.com/public/name-of-project/items/products/1?access_token=TOKEN';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['category'=>43]));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
我究竟做错了什么?