concrete/src/Http/Service/Ajax.php
public function sendResult($result)
    {
        if (@ob_get_length()) {
            @ob_end_clean();
        }
        if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false) {
            header('Content-Type: application/json; charset=' . APP_CHARSET, true);
        } else {
            header('Content-Type: text/plain; charset=' . APP_CHARSET, true);
        }
        echo json_encode($result);
        die();
    }
public function sendResult($result)
    {
        if (@ob_get_length()) {
            @ob_end_clean();
        }
        if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false) {
            header('Content-Type: application/json; charset=' . APP_CHARSET, true);
        } else {
            header('Content-Type: text/plain; charset=' . APP_CHARSET, true);
        }
        echo json_encode($result);
        die();
    }
public function sendResult ( $ result ) { if ( @ ob_get_length ( ) ) { @ ob_end_clean ( ) ; } if ( isset ( $ _SERVER [ 'HTTP_ACCEPT' ] ) && strpos ( $ _SERVER [ 'HTTP_ACCEPT' ] , 'application/json' ) !== false ) { header ( 'Content-Type: application/json; charset=' . APP_CHARSET , true ) ; } else { header ( 'Content-Type: text/plain; charset=' . APP_CHARSET , true ) ; } echo json_encode ( $ result ) ; die ( ) ; }
Sends a result to the client and ends the execution.

@param mixed $result

@deprecated You should switch to something like:
return \Core::make(\Concrete\Core\Http\ResponseFactoryInterface::class)->json(...)
Sends a result to the client and ends the execution .