[go: up one dir, main page]

Menu

[3822d7]: / tests / get.php  Maximize  Restore  History

Download this file

25 lines (19 with data), 733 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
require(__DIR__ . '/../vendor/nategood/httpful/bootstrap.php');
// STEP 1: configure API function to connect and authenticate with ICTBroadcast server
function ictcore_api($method) {
$api_url = 'http://core.voip.vision';
$username = 'admin';
$password = 'helloAdmin';
$service_url = "$api_url/$method";
echo $service_url."\n";
$response = \Httpful\Request::get($service_url) // Build a PUT request...
->expectsJson() // we are receiving in json
->authenticateWith($username, $password) // authenticate with basic auth...
->send();
return $response->body;
}
$request = end($argv);
$result = ictcore_api($request);
echo print_r($result, true)."\n";
exit(0);