我正在尝试在Wordpress站点中创建一个API端点,该端点可以接收AWS简单通知服务通知。我现在有这个工作,但在前端,该网站没有加载。以下是代码摘录:
require_once MY_PLUGIN_DIR . \'/libs/aws/aws-autoloader.php\';
use Aws\\Sns\\Message;
use Aws\\Sns\\MessageValidator;
function sns_endpoint() {
add_rewrite_tag( \'%apitest%\', \'([^&]+)\' );
add_rewrite_rule( \'test/([^&]+)/?\', \'index.php?apitest=$matches[1]\', \'top\' );
}
add_action( \'init\', \'sns_endpoint\' );
function sns_endpoint_data() {
// this line caused the site not to load
$message = Message::fromRawPostData();
/* additional code follows... */
}
add_action( \'template_redirect\', \'sns_endpoint_data\' );
没有任何内容写入调试。日志更新:错误日志中写入了一个错误:SNS消息类型标头没有提供任何解决方法的想法?