HTTP_RAW_POST_DATA not getting read

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
irish
Forum Members
Forum Members
Posts: 101
Joined: Tue Jun 03, 2008 2:31 pm

HTTP_RAW_POST_DATA not getting read

Post 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?
Post Reply

Return to “Developers Discussion”