Update Server.php

This commit is contained in:
2023-01-25 12:39:15 +01:00
committed by GitHub
parent ec9a681cba
commit a5f3d3d0fd

View File

@@ -36,18 +36,15 @@ class Server
}
$payload = [
'header' => [
'apikey' => $this->apiKey,
'secret' => $this->apiSecret,
],
'body' => [
'command' => $command,
'params' => $attributes
]
'command' => $command,
'params' => $attributes
];
$token = base64encode(sprintf('%s:%s', $this->apiKey, $this->apiSecret))
$response = $this->client->post("api.php", [
'headers' => [
'Authorization' => 'Basic ' . $token,
'Content-Type' => 'application/json',
],
'body' => json_encode($payload)