In my case, I was looking for a way to change the HTTP verb mappings with AgaviWebRequest methods.
Agavi maps executeCreate() with HTTP PUT and executeWrite() with HTTP POST. If I use these functions in the context of REST architecture, it makes more sense if they are mapped the other way around. Although I understand that there is no single way to implement REST, there seems to be a general agreement that update operations should be mapped to HTTP PUT while create operations should be mapped to HTTP POST.
Fortunately, Agavi provides a simple (undocumented) way to change the mappings. In config/factories.xml, simply add:
<request class="AgaviWebRequest">Thanks to the crazy guy, MikeSeth. =)
<parameter name="method_names">
<parameter name="POST">create<parameter>
<parameter name="GET">read<parameter>
<parameter name="PUT">write<parameter>
<parameter name="DELETE">delete<parameter>
<parameter>
<request>
No comments:
Post a Comment