so nun aber richtig

This commit is contained in:
troy 2022-01-23 00:51:10 +01:00
parent b689d73065
commit 2e5b29bd9d

View File

@ -1,11 +1,12 @@
<?php <?php
function sendToTroy($data) { function sendToTroy($data) {
$url = 'https://troy-grunt.de/api.php'; $url = 'https://troy-grunt.de/api.php';
// use key 'http' even if you send the request to https://...
$options = array ( $options = array (
'http' => array ( 'http' => array (
'method' => 'POST', 'method' => 'POST',
'Content-Type' => 'application/json', 'header' => array (
'Content-Type: application/json'
),
'content' => json_encode ( $data ) 'content' => json_encode ( $data )
) )
); );