FuelPHP unexpectedly returns Arr instead of data accessing REST controller with no format specified

When working with the REST Controller in FuelPHP and accessing it from your browser you see “Arr” when a format is not specified in the URL instead of the expected data in your default format. This is because of a setting in the rest.php config file (fuel/core/config/rest.php OR /fuel/app/config/rest.php).

Change:

<pre>’ignore_http_accept’ => false,</pre>

to:

<pre>’ignore_http_accept’ => true,</pre>

 

This is faster and will make your default the default format as expected.  If the client needs the data in another format they can specify it in the URL.

Leave a Reply

Your email address will not be published. Required fields are marked *