我正在尝试为将更新特定建筑物记录的应用程序添加 API 调用。这是它的简单版本,但它似乎没有做任何事情(包括错误)。我错过了什么?任何想法表示赞赏!
调用 API 方法的 url:
http://example.com/api/request/UpdateBuilding/<token>/156/The%20Atticus%Building/120%20Finch%20Street%20Monroeville/50830
方法源代码:
private function UpdateBuilding() {
$buildingId=@$this->params['pass'][2];
$name=@$this -> params['pass'][3];
$address=@$this -> params['pass'][4];
$zip=@$this -> params['pass'][5];
$this->data=array(
"id"=>$buildingId,
"name"=>$name,
"address"=>$address,
"zip_code"=>$zip
);
$this->Building->save($this->data);
}