Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 2070

Joomla! 5.x Coding • JSON response - 503 Service Unavailable

$
0
0
When I try the following simple JSON response component (com_jsonresponse) on a Joomla 5 (Joomla! 5.0.3 / PHP 8.1.27) installation the response is rendered as expected, but the response code is 503 Service Unavaialable.

Code:

<?phpdefined('_JEXEC') or die('Restricted access');use Joomla\CMS\Response\JsonResponse;echo new JsonResponse("hello world!", "It worked!");
tested with postman
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?

Statistics: Posted by digital_project — Sun Mar 24, 2024 3:59 pm



Viewing all articles
Browse latest Browse all 2070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>