Dancer::Plugin::EmptyGIF - Quick empty GIF response
use Dancer; use Dancer::Plugin::EmptyGIF; get '/tracking/pixel.gif' => sub { # do something with params return empty_gif; }
This will set your set your current request response to be an empty gif, this means, it will return binary data for the image and set the appropriate headers. You should always "return empty_gif".
An empty gif response is specially useful when you're building a webservice that processes all the URL and/or query string parameters and at the end, an empty gif needs to be returned to the client. This a tracking or reporting pixel. Once the request has reached your application code, it's better not to do any more redirections and quickly return the empty pixel from within your code.
David Moreno <david at axiombox dot com>
<david at axiombox dot com>
http://github.com/damog/Dancer-Plugin-EmptyGIF
Copyright, David Moreno, 2012
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Dancer::Plugin::EmptyGIF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Plugin::EmptyGIF
CPAN shell
perl -MCPAN -e shell install Dancer::Plugin::EmptyGIF
For more information on module installation, please visit the detailed CPAN module installation guide.