phpcakephpcakephp-2.0superfeedr

Can't get Superfeedr callback response in CakePHP


I already added this URL to my subscribers list: http://push-pub.appspot.com/

BTW, I also setting well the callback URL, like: http://online-domain.com/data/forward

My controller code:

public function forward() {
    $this->autoRender = false
    CakeLog::write('debug', 'Callback work!!');
    CakeLog::write('debug', json_encode($this->request->data));
}

But, in my debug.log:

2013-12-23 06:06:47 Debug: Callback work!!
2013-12-23 06:06:47 Debug:
2013-12-23 06:07:38 Debug: Callback work!!
2013-12-23 06:07:38 Debug:
2013-12-23 06:12:59 Debug: Callback work!!
2013-12-23 06:12:59 Debug:

I no idea why $this->request->data not working, it should get the callback data from superfeedr. I want get callback from superfeedr. Any guys know what was I wrong? Thanks you in advance.


Solution

  • I am not familiar with CakePHP, however, I know that most frameworks will assume that the body of a POST request is the content from a form and hence will fail to show the content from a Superfeedr notification. You want to access the "raw" version of the BODY. This answer may be able to help (provided you can access the right variables directly).