All Products
Search
Document Center

:Cannot receive the message body with a PHP HttpEndpoint in Simple Message Queue (formerly MNS)

Last Updated:Sep 03, 2026

Problem description

You cannot receive the message body when you use a PHP script as an HttpEndpoint in Simple Message Queue (formerly MNS).

Problem cause

This issue occurs because the PHP script uses the $_POST[] method to retrieve the HTTP body. The $_POST[] method only accepts data submitted from a form with the following content type:

  • application/x-www-form-urlencoded

However, MNS push requests only support the following three content types.

  • text/xml;charset=utf-8

  • text/plain;charset=utf-8

  • application/json;charset=utf-8

Solution

Check your PHP code. If it uses the $_POST[] method to retrieve the HTTP body, change the code as follows.

file_get_contents("php://input");
Note

This method lets you read the raw POST data. It works for POST data with different content types. You can also use it to retrieve raw data when no content type is specified.

References

HttpEndpoint interface specifications