CGI::Test::Input::Custom - send custom data to CGIs for testing
use CGI::Test; use CGI::Test::Input::Custom; my $ct = CGI::Test->new(...); my $input = CGI::Test::Input::Custom->new(); $input->set_mime_type('text/xml', -encoding => 'utf8'); $input->add_content(<<EOX); <?xml version="1.0" encoding="UTF-8"?> <FooBar> <Chanel>Whatever</Chanel> <Date>20080304231200</Date> </FooBar> EOX my $page = $ct->POST('http://www.foo.org/cgi/sendMeXML', $input);
This module allows to send custom data to CGIs on POST requests when using the CGI::Test framework.
These are the methods available:
creates a new input object.
The accepted arguments are as follows:
mime type of the content. Default is application/octect-stream.
application/octect-stream
data to send in the request
encoding to use when converting data from internal perl representation to on-the-wire format. Default is utf8.
See Encode.
sets the mime type
appends data to be sent to the CGI
Test::CGI, Test::CGI::Input, Internet media types (aka MIME types) entry on the Wikipedia.
Salvador Fandiño, <sfandino@yahoo.com>
Copyright (C) 2008 by Qindel Formacion y Servicios S.L.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install CGI::Test::Input::Custom, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CGI::Test::Input::Custom
CPAN shell
perl -MCPAN -e shell install CGI::Test::Input::Custom
For more information on module installation, please visit the detailed CPAN module installation guide.