change code in some item

This commit is contained in:
2025-09-24 14:41:11 +03:30
parent f303c6c19c
commit ff616914ac
5 changed files with 55 additions and 22 deletions

View File

@@ -16,8 +16,6 @@ class GetErrorRateService
public function __construct()
{
$this->url = config('fms_web_services.Error_Rate.url');
$this->password = config('fms_web_services.Error_Rate.password');
$this->username = config('fms_web_services.Error_Rate.username');
$this->channelName = 'fms_error_rate';
}
@@ -49,22 +47,10 @@ class GetErrorRateService
public function sendRequest(): array
{
$inputData = $this->makeInputParameters();
return Http::withBody($inputData)
return Http::withHeaders(['Content-Type' => 'application/json'])
->throw()
->withoutVerifying()
->post($this->url)
->post($this->url, $this->inputParameters)
->json();
}
private function makeInputParameters(): string
{
$inputData = $this->inputParameters + array(
"username" => $this->username,
"password" => $this->password,
);
return json_encode($inputData);
}
}