Code: Select all
<?php
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Response\JsonResponse;
echo new JsonResponse("hello world!", "It worked!");
POST on https://<domain>/index.php?option=com_jsonresponse&format=json
Result
{
"success": true,
"message": "It worked!",
"messages": null,
"data": "hello world!"
}
Status: 503 Service Unavailable
What is wrong with this code?