Page 1 of 1

HTTP_RAW_POST_DATA not getting read

Posted: Mon Apr 12, 2010 4:43 pm
by irish
Hi, I am trying to set up an API web services. I wrote the code and tested it, it works fine outside of CMSMS. But once I put it into a module and test it, it doesn't seem to be able to read the raw data:

Code: Select all

if (isset($HTTP_RAW_POST_DATA)) {
 $request_xml = $HTTP_RAW_POST_DATA;
}
else {
 $request_xml = implode("\r\n", file('php://input'));
}
Here is what I done:
  • Created a module (API)
  • Set up the default page to capture the raw data
  • Added a content page to call the API module - {cms_module module="API"}
  • Called the API from another website using Curl
It doesn't read the input at all.

I created a page on the root with the same code as the API module default page, and that worked fine. I would use this page but I don't know how to call the modules from there as it is not part of the cmsms.

Any idea why the HTTP_RAW_POST_DATA is not being read?