Hi Corion, apologies, it is 0500 and I was posting on phone. Back at PC now.
This is a Dancer app running nicely with starman.
This code results in the browser downloading a CSV file:
get '/test/csv' => sub {
my $csv = "foo, bar, baz";
send_file( \$csv, content_type => 'text/csv', filename => 'qux.csv
+' );
};
While this code results in nothing: no error in the log, no content returned to browser:
post '/test/csv' => sub {
my $csv = "foo, bar, baz";
send_file( \$csv, content_type => 'text/csv', filename => 'qux.csv
+' );
};
I am using POST since the request is made from JS which knows about the user's environment.
The way forward always starts with a minimal test.
|