diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index 78cbf8e..79ba2fa 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -175,9 +175,9 @@ abstract class BaseController extends Controller $ch = curl_init( $url ); # Setup request to send json via POST. $payload = json_encode( $params ); - + $authorization = "Authorization: Bearer ".$ansibleToken; // Prepare the authorisation token curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload ); - curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); + curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json',$authorization)); # Return response instead of printing. curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); # Fetch the headers, not the body content: