Test ogdClient
testing/ogcore-api/pipeline/head This commit looks good Details

pull/12/head
Manuel Aranda Rosales 2024-10-23 10:49:55 +02:00
parent 354b18c068
commit 8c30def21a
1 changed files with 7 additions and 4 deletions

View File

@ -41,10 +41,13 @@ class StatusAction extends AbstractController
try {
$response = $this->httpClient->request('POST', 'https://' . $client->getIp() . ':8000/ogAdmClient/status', [
'verify_peer' => false,
'verify_host' => false,
'timeout' => 10,
'body' => ['hola' => 'mundo']
'verify_peer' => false, // Desactivar verificación del certificado
'verify_host' => false, // Desactivar verificación del nombre del host
'timeout' => 10, // Tiempo máximo de espera
'headers' => [
'Content-Type' => 'application/json', // Cabecera de tipo de contenido
],
'json' => ['hola' => 'mundo'], // Cuerpo de la solicitud como JSON
]);
$statusCode = $response->getStatusCode();
$client->setStatus($statusCode === Response::HTTP_OK ? 'active' : 'off');