As I interpret, we can set default output format for all REST controllers in the config and we can change this by the extension with an action call, for example, ajax/get_tab.html?num=1
Can I set stiffly for some action of the REST controller or for all actions of the REST controller certain output format?
One observation. If I use Hybrid (I don't try it in pure REST), I need use prefix 'action_' before 'get' or 'post' etc. It is not documented elsewhere.
In documentation of REST said:
You'll notice that instead of the usual "action_" prefix the Rest Controller uses the HTTP method as a prefix.
That is true for all controllers, it is a generic feature, not limited to REST. If a "{HTTP_METHOD}_name" method exists, it will be called instead of "action_name". It allows you to split GET and POST processing for standard forms too.
I don't understand what you mean by "Can I set stiffly..."?
The reason for this is simple and two-fold, it avoids collisions with existing PHP function names (you can't have a method called 'list'), and it allows you to define methods that are not callable from the URI.
So either use the default "action_" prefix, which gets called on any HTTP method request, or use specific HTTP-METHOD prefixes like "get_", "post_", "put_", "delete_" or "patch_" to override the default prefix.
Note that you can do both. If you define "action_list" and "post_list" in your controller, requesting /controllername/list will call "action_list", posting a form on that page will result in a call to "post_list".
If you want to know if you can override the format by setting a fixed format using the controller property 'format', that will disable any auto-detection. If auto-detection is enabled, the flow as documented is followed. This is not new, but was added for clarification a few months ago, since more people asked how it exactly works.
>>So either use the default "action_" prefix, which gets called on any HTTP method request, or use specific HTTP-METHOD prefixes like "get_", "post_", "put_", "delete_" or "patch_" to override the default prefix.
Excuse me for my incompliance, but in Controller extended from Controller_Hybrid in version 1.7 of framwork (my conditions) does not work 'get_' methods and only work 'action_get_'. I just check it once more again.
But it is not important for me, now... I have another problem 'Connection: keep-alive' on rest response...