HPE iLO 5 Rest API Using php

				
					public function Get_ILO5_Details($IPv4Addr, $user_name, $password, $API_Dir)
{
     $IPv4Addr = '192.168.1.2';
     $user_name = 'Administrator';
     $password = 'iLO 5 Password';
     $contentType = "application/json";
     $URL = 'https://' . $IPv4Addr . '/redfish/v1/' . $API_Dir;

     $ch = curl_init();

     curl_setopt($ch, CURLOPT_URL, $URL);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
     curl_setopt($ch, CURLOPT_HTTPHEADER, Array('Accept: ' . $contentType));
     curl_setopt($ch, CURLOPT_HTTPHEADER, Array('Content-Type: application/json'));
     curl_setopt($ch, CURLOPT_HTTPHEADER, Array('OData-Version: 4.0'));
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
     curl_setopt($ch, CURLOPT_USERPWD, $User_name . ':' . $Password);

     $response = curl_exec($ch);
     if (curl_errno($ch)) {
         echo 'Error:' . curl_error($ch);
     }


     curl_close($ch);
     $response = json_decode($response, true);
     // This will dump the responce to the scree.
     // Good to do if it is the first time you have run this.
     // var_dump($response);

     echo '<br><br><br>';

     return $response;
}