$authorization

This commit is contained in:
CHIEFSOFT\ameye
2025-01-26 19:35:55 -05:00
parent 3631ec1fb1
commit d7ba066f36
+2 -2
View File
@@ -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: