15 lines
461 B
PHP
15 lines
461 B
PHP
<?php
|
|
function sendToTroy($data) {
|
|
$url = 'https://troy-grunt.de/api.php';
|
|
// use key 'http' even if you send the request to https://...
|
|
$options = array (
|
|
'http' => array (
|
|
'method' => 'POST',
|
|
'Content-Type' => 'application/json',
|
|
'content' => json_encode ( $data )
|
|
)
|
|
);
|
|
$context = stream_context_create ( $options );
|
|
return file_get_contents ( $url, false, $context );
|
|
}
|
|
?>
|