Add call to curl to command. #704

This commit is contained in:
Korina Cordero 2022-09-19 06:27:03 +00:00
parent 70e9b933d9
commit d9aaea928c

View file

@ -378,6 +378,26 @@ class LoadWarrantySerialCommand extends Command
error_log(print_r($json_output, true)); error_log(print_r($json_output, true));
// TODO: sent json output somewhere // TODO: sent json output somewhere
$curl = curl_init();
$options = [
CURLOPT_URL => $this->base_url . '/' . $url,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $body,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Ocp-Apim-Subscription-Key: ' . $this->sub_key,
'Authorization: Bearer ' . $this->token,
],
];
curl_setopt_array($curl, $options);
$res = curl_exec($curl);
curl_close($curl);
} }
} }