【发布时间】:2014-09-07 05:06:31
【问题描述】:
由于某种原因,我似乎无法通过 Restler 调用 DELETE 方法。在我的 restler php 文件中,我定义了一个这样的方法:
/**
* Drop invitation
*
* Removes an invitation from the system. Coaches want a way to be able
* to remove an invite if they messed up, or the person just doesn't accept.
*
* @param string $email The email address of the invited person {@from body}
* @param int $team_id The SQL identifier for the team {@from body}
*
* @return array An empty array
*/
public function deleteInvite($email, $team_id) {
return [];
}
当我尝试调用它时:
curl -X DELETE -H "Content-Type: application/json" -d '{"email":"foo","team_id",17}' http://server.com/app/团队/邀请
返回 400 错误:
{ “错误”: { “代码”:400, "message": "错误请求:电子邮件丢失。" } }
我该怎么称呼它?
【问题讨论】:
标签: restler