-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
33 lines (24 loc) · 767 Bytes
/
index.php
File metadata and controls
33 lines (24 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
// Execute PHP Cron script here
try {
$data = array("<KEY>" => "<VALUE>", "<KEY>" => "<VALUE>");
$data_string = json_encode($data);
$ch = curl_init('<ENDPOINT>');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Bearer <TOKEN>',
'Content-Length: ' . strlen($data_string)) );
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$result = curl_exec($ch);
curl_close($ch);
print_r($result);
//echo json_decode($result);
} catch (Exception $e) {
print "something went wrong\n";
} /*finally {
print "This part is always executed\n";
}*/
?>