无法收到确认订阅请求

嗨,我无法收到来自亚马逊的确认订阅请求,尝试了一切。 我的端点网址是: http://example.com/test/testhttp://example.com/test/test 。 我试过以下代码片段来接收响应:1) - >

$headers = apache_request_headers();
$body = @file_get_contents('php://input');
file_put_contents(Path to file."json_sns.txt", serialize(print_r($headers, 1)."n---body---n".$body));

2) - >

$h= fopen("php://input","r");
$X = stream_get_contents($h);
$J = json_decode( $X , true);
file_put_contents(Path to file."json_sns.txt", serialize(print_r($headers, 1)."n---body---n".$body));

3) - >

file_put_contents(Path to file."json_sns.txt", serialize($_POST));

还有更多,但没有成功。 验证端点url是通过浏览器访问的。 订阅是在有未决确认状态的sns控制台中。

请帮助我如何接收来自亚马逊的回应,并指出如果我在代码中做了错误的事情,或者我错过了任何步骤。 谢谢。


解决了这个问题,实际上CSRF令牌导致了这个问题,因为亚马逊请求没有完成,为它的请求增加了一个异常,然后它像一个魅力一样工作。 :)

链接地址: http://www.djcxy.com/p/32147.html

上一篇: Unable to receive confirm subscription request

下一篇: Confirm SNS subscription on HTTP