Unable to receive confirm subscription request

Hi i am not able to receive the confirm subscription request from Amazon, tried everything. My endpoint url is: http://example.com/test/test . I have tried following snippets of code to receive response: 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));

and many more, yet no success. Verified that the endpoint url is accessible through browser. Subscription is there in sns console with pending confirmation status.

Please help me how to receive the response from amazon, also point out if i have done something wrong in my code or i have missed out any step. Thanks.


Resolved the issue, actually CSRF token was causing the problem, due to which Amazon request wasn't completing, added a exception for its request, and then it worked like a charm. :)

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

上一篇: 针对移动应用的Amazon SNS主题订阅确认

下一篇: 无法收到确认订阅请求