我对Pinterest API有问题。
我想重命名板。 我写下面的代码
$access_token = "removed";
function rename_board($access_token, $now_board_name, $new_board_name) {
$url = 'https://api.pinterest.com/v1/boards/'.$now_board_name.'/?access_token='.$access_token;
$curlPost = 'board='.$now_board_name.'&name='.$new_board_name;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
$data = json_decode(curl_exec($ch), true);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
print "<br>";
print $http_code;
}
rename_board($access_token, "1234", "AAA");
我得到一个错误:405