title: Capturing Catalyst Response Body of Another Action
body: <p>On one of my pages, I'm trying to go grab the contents of another page from a different controller, and then take that HTML and use it to make a little "widget" on the first page.</p>
  
  <p>If I was grabbing off the current page, I could just do:</p>
  
  <pre><code>my $html = $c-&gt;response-&gt;body();
  </code></pre>
  
  <p>But since it is in another controller, I can't figure out how to get it.</p>
  
  <p>An additional (potential) complication is that the action in question needs an arg passed to it.</p>
  
  <p>I tried <code>my $html = $c-&gt;visit('/action/')-&gt;body();</code> - a shot in the dark - which I troubleshooted in another recent post.  But that just seems to take over the current action, rather than allowing me to just grab the response from it.</p>
  
  <p>The only thing I could think of (and this is untested) is storing the response of page 1, doing my <code>$c-&gt;visit</code>, storing that response, then taking page 1's original response and outputting that right at the end.  Seems overly convoluted, but that's the best I can think of.</p>
  
  <p>Any ideas?</p>