The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

VERSION

version 0.003

NAME

WWW::IRail::API::Connections - HTTP::Request builder and HTTP::Response parser for the IRail API (Train)Connection data

SYNOPSIS

    make_request( from => 'brussel noord', to => 'oostende' );

DESCRIPTION

This module builds a HTTP::Request and has a parser for the HTTP::Response. It's up to you to transmit it over the wire. If don't want to do that yourself, don't use this module directly and use WWW::IRail::API instead.

METHODS

make_request( key = 'val'> | { key = 'val' }> )

from and to are the only arguments required, all time and date arguments default to the current time and date on the iRail API side.

    make_request (
        from    => 'oostende',
        to      => 'brussel noord',
        date    => '2010-11-28' || '20101128' || 'tomorrow afternoon',   
        time    => '6:24' || 1290922133,        
    );

parse_response( $http_response, dataType )

parses the HTTP::Response you got back from the server, which if all went well contains XML. That XML is then transformed into other data formats

  • xml

  • XML

  • YAML

  • JSON

  • perl (default)

example of output when dataType = 'xml'

METHODS

example of output when dataType = 'XML'

example of output when dataType = 'JSON'

example of output when dataType = 'YAML'

example of output when dataType="perl" (default)

INSTALLATION

See perlmodinstall for information and options on installing Perl modules.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests through the web interface at http://rt.cpan.org.

AUTHOR

Tim Esselens <tim.esselens@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Tim Esselens.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.