JSON response - 503 Service Unavailable

For Joomla! 5.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
digital_project
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Mar 24, 2024 3:41 pm

JSON response - 503 Service Unavailable

Post by digital_project » Sun Mar 24, 2024 3:59 pm

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: Select all

<?php
defined('_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?

Post Reply

Return to “Joomla! 5.x Coding”