Php蛋糕post请求

Php蛋糕post请求,php,web-services,cakephp,rest,Php,Web Services,Cakephp,Rest,我正在用PHP开发restful服务。我开发了所有get服务。但我在邮政服务方面有点迟钝 问题是,我无法获取post数据。我在$this->data中没有得到任何东西 这里是一个控制器功能的代码。 function signin() { $this->view = 'Webservice.Webservice'; $message = "Request Received"; if (!empty($this->data)) { $messag

我正在用PHP开发restful服务。我开发了所有get服务。但我在邮政服务方面有点迟钝

问题是,我无法获取post数据。我在$this->data中没有得到任何东西

这里是一个控制器功能的代码。

function signin() {

    $this->view = 'Webservice.Webservice';
    $message = "Request Received";
    if (!empty($this->data)) {
        $message = "Request has data";
    }


     $this->set(compact('message'));
}
这是我的请求数据

POST http://localhost/blog/posts/signin HTTP/1.1
User-Agent: Fiddler
Host: localhost
Content-Length: 25

username=abc&password=abc
请帮帮我


谢谢,

Cake仅通过发送到PHP并以“data”为前缀的数据填充请求数据数组

请按以下方式发布您的用户名和密码:

data[username]=abc&data[password]=abc

这将告诉Cake将其放置在
$This->request->data

中,非常感谢您的回复。但是这也不起作用。你在使用安全组件吗?它被黑了吗?您是否通过firebug检查了请求/响应?如果您使用的是2.x,是否确保使用
$this->request->data
?我没有使用安全组件。我使用的是1.3版本。是的,我用FireBug检查了请求/响应。您是否尝试过在config/core.php中关闭checkAgent?查找
Configure::write('Session.checkAgent',true)
并将其设置为false。这也不会带来好运。我正在使用$message=file\u get\u contents('php://input'); 但不是用这个->数据