how to confirm sns subscription https php

Solutions on MaxInterview for how to confirm sns subscription https php by the best coders in the world

showing results for - "how to confirm sns subscription https php"
Salvatore
13 Jun 2017
1<?php
2$json_write_to_text = file_get_contents("php://input"); //read the raw data 
3$json_write_to_text = json_decode($json_write_to_text, TRUE, 512, JSON_OBJECT_AS_ARRAY);
4
5if($json_write_to_text['Type'] == SubscriptionConfirmation)
6{
7 $curl = curl_init();
8
9 curl_setopt_array($curl, array(
10  CURLOPT_URL => $json_write_to_text['SubscribeURL'],
11  CURLOPT_RETURNTRANSFER => true,
12  CURLOPT_CUSTOMREQUEST => "GET",
13  CURLOPT_HTTPHEADER => $header,
14 ));
15
16 $response = curl_exec($curl);
17 $err = curl_error($curl);
18
19 curl_close($curl);
20}
21
22file_put_contents("response.txt",print_r($json_write_to_text,true)); // this is just for dumping the raw data and can be omitted 
23?>