die troy api
This commit is contained in:
parent
b035d8c2d9
commit
6bec287363
15
troy-api.php
Normal file
15
troy-api.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
function sendToTroy($data) {
|
||||||
|
$url = 'https://troy-grunt/api.php';
|
||||||
|
// use key 'http' even if you send the request to https://...
|
||||||
|
$options = array (
|
||||||
|
'http' => array (
|
||||||
|
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
|
||||||
|
'method' => 'POST',
|
||||||
|
'content' => json_encode ( $data )
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$context = stream_context_create ( $options );
|
||||||
|
return file_get_contents ( $url, false, $context );
|
||||||
|
}
|
||||||
|
?>
|
||||||
Loading…
Reference in New Issue
Block a user