По какой-то причине я, похоже, не могу вызвать методы DELETE через Restler. В моем файле PHP restler я определил метод следующим образом:Методы DELETE, которые не могут быть вызваны
/**
* 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/team/invite
Он возвращается с ошибкой 400:
{ "error": { "code": 400, "message": "Bad Request: email is missing." } }
Как я должен это назвать?
Спасибо. Почему это «лучшая практика»? – Gargoyle