简体   繁体   English

Restler GET有效,但POST返回404

[英]Restler GET works, but POST returns 404

I have a simple class for Restler ( http://luracast.com/products/restler ) like so: 我有一个Restler的简单类( http://luracast.com/products/restler ),如下所示:

class Team extends PostgreSQL {
    function post($name) {
    }

    function players($teamId) {
    }
}

If I run a curl GET, like so: curl http://.../team/players/1 如果我运行curl GET,例如: curl http://.../team/players/1

I get back the expected data. 我得到了预期的数据。 If I run a POST, like below, I always get a 404: 如果我运行POST,如下所示,则总会收到404:

curl -X POST http://.../team -H "Content-Type: application/json" -d '{"name": "Team name here"}

I'm not understanding why the POST gives a 404 Not Found. 我不明白为什么POST会给出404 Not Found。

curl -X POST http://.../team/Team%20Name%20Here

这就是期望该职位通过的方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM