Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $url = 'http://192.168.1.190/api/SUsc-E6wbcfoFbd7TLTOFTRB3hTny2pHTilHJhXe/groups/0/action';
- $data = array("alert"=>"select");
- $data = json_encode($data);
- // 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' => 'PUT',
- 'content' => http_build_query($data)
- )
- );
- $context = stream_context_create($options);
- $result = file_get_contents($url, false, $context);
- if ($result === FALSE) { /* Handle error */ }
- var_dump($result);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment