I have a number of chained actions that use an end() method that generates a json response in a view.<div><br></div><div>Another developer added an action to support a POST, and at the end of the action they call $c-&gt;visit on a few actions to build up a response -- I assume to avoid making a few extra ajax requests.  $c-&gt;visit does a full dispatch so auto and end methods are called for each visit, plus for the original action.  But, because of the chained actions, $c-&gt;visit makes running the requests very simple.</div>

<div><br></div><div>Yes, normally the POST would be followed by a redirect, but this POST is a file upload in an iframe an a json response is desired.  But, doing this partial re-dispatch has also come with GET requests.</div>

<div><br></div><div><br></div><div>Any tricks to do a $c-&gt;visit type of call but w/o doing a full dispatch, that is, without calling the auto and end actions?</div><div><br></div><div>I suppose I could do something like this, but it&#39;s not very pretty.</div>

<div><br></div><div><div>    for my $action_name ( @action_names_to_run ) {</div><div>        local $c-&gt;req-&gt;{method} = &#39;GET&#39;;</div><div>        local $c-&gt;request-&gt;{arguments} = [];</div><div>        local $c-&gt;request-&gt;{captures}  = [ $item_id ];</div>

<div><br></div><div>        my $action = $c-&gt;controller-&gt;action_for( $action_name );</div><div>        $action = $c-&gt;dispatcher-&gt;expand_action($action);</div><div>        local $c-&gt;{action} = $action;</div>

<div><br></div><div>        $action-&gt;dispatch( $c );</div><div>    }</div><div><br></div><br>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org">moseley@hank.org</a><br>
</div>