[rt-devel] Custom http headers from WebRT template

Rich Lafferty rich+rt at lafferty.ca
Fri Nov 22 10:12:43 EST 2002


How can I set a custom HTTP header from a template in RT 2.0.15?

I've got a fragment like this at the top of a template:

<%perl>
  if ($resultType eq 'CSV') {
     SetContentType("text/csv");
     SetHeader("Content-Disposition" => 'filename="rt-priority.csv"');

     my $out = [stuff to generate some CSV]

     $m->out($out); 
     $m->abort; 
  }
</%perl>

Obviously, the SetHeader line doesn't work because there is no 
SetHeader. What should I use there?

  -Rich

-- 
Rich Lafferty --------------+-----------------------------------------------
 Ottawa, Ontario, Canada    |  Save the Pacific Northwest Tree Octopus!
 http://www.lafferty.ca/    |    http://zapatopi.net/treeoctopus.html
rich at lafferty.ca -----------+-----------------------------------------------



More information about the Rt-devel mailing list