Add call to curl to command. #704
This commit is contained in:
parent
70e9b933d9
commit
d9aaea928c
1 changed files with 20 additions and 0 deletions
|
|
@ -378,6 +378,26 @@ class LoadWarrantySerialCommand extends Command
|
|||
error_log(print_r($json_output, true));
|
||||
|
||||
// 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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue