Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(-1);
- ini_set('display_errors',true);
- $StretchIp = "192.168.1.10";
- $StretchId = "qwert";
- $StretchPath = "/core/appliances";
- $url = "http://" . $StretchIp . $StretchPath;
- $host = $StretchIp;
- $username = "stretch";
- $password = $StretchId;
- $header = [
- 'Host: ' . $host,
- 'Authorization: ' . base64_encode($username . ':' . $password),
- 'Content-Type: application/xml'
- ];
- $options = [
- 'http'=>[
- 'method' => 'GET',
- 'header'=>implode("\n",$header)
- ]
- ];
- $context = stream_context_create($options);
- $response = file_get_contents($url, false, $context);
- echo $response;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement