vtenext/include/RestApi/InternalClient.php
2021-04-28 20:10:26 +02:00

28 lines
747 B
PHP

<?php
/*************************************
* SPDX-FileCopyrightText: 2009-2020 Vtenext S.r.l. <info@vtenext.com>
* SPDX-License-Identifier: AGPL-3.0-only
************************************/
/* crmv@170283 */
namespace RestService;
/**
* This client does not send any HTTP data,
* instead it just returns the value.
*
* Good for testing purposes.
*/
class InternalClient extends Client
{
public function sendResponse($pHttpCode = '200', $pMessage)
{
$pMessage = array_reverse($pMessage, true);
$pMessage['status'] = $pHttpCode+0;
$pMessage = array_reverse($pMessage, true);
$method = $this->getOutputFormatMethod($this->getOutputFormat());
return $this->$method($pMessage);
}
}