Created
March 26, 2021 03:19
-
-
Save mdestafadilah/259b82ed02d6737aab477488cffc6f29 to your computer and use it in GitHub Desktop.
SCALEDRONE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$channel_id = "K3gfQWyPfnlARdfu"; | |
$channel_secret = "ilQTV3cM7LzSqS9QM4RBudK38Ohdvnai"; | |
$room_name = "surat"; | |
$auth = base64_encode("$channel_id:$channel_secret"); | |
$url = "https://api2.scaledrone.com/$channel_id/$room_name/publish"; | |
$data = array('key1' => 'value1', 'key2' => 'value2'); | |
$options = array( | |
'http' => array( | |
'header' => array( | |
"Content-type: application/json", | |
"Authorization: Basic $auth", | |
), | |
'method' => 'POST', | |
'content' => json_encode($data) | |
) | |
); | |
$context = stream_context_create($options); | |
$result = file_get_contents($url, false, $context); | |
if ($result === FALSE) { /* Handle error */ } | |
var_dump($result); | |
exit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment