You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug CodeIgniter\RESTful\ResourceController allows (according to the documentation and source code) specifying output format by setting protected $format to xml or json. There is even ResourceController::setFormat helper.
It doesn't work however as $format seems to be ignored.
In practice calling ResponseTrait::respond results in calling ResponseTrait::format which negotiates output format:
Describe the bug
CodeIgniter\RESTful\ResourceController
allows (according to the documentation and source code) specifying output format by settingprotected $format
toxml
orjson
. There is evenResourceController::setFormat
helper.It doesn't work however as
$format
seems to be ignored.In practice calling
ResponseTrait::respond
results in callingResponseTrait::format
which negotiates output format:E.g. I get XML when opening page in web browser and JSON when using CLI
curl
.CodeIgniter 4 version
4.0.2
Affected module(s)
ResourceController
andResponseTrait::format
.Expected behavior, and steps to reproduce if appropriate
protected $format = 'xml';
should always generate XML responseprotected $format = 'json';
should always generate JSON responseThe text was updated successfully, but these errors were encountered: