API-DirectAdmin

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

use 5.008008;
use ExtUtils::MakeMaker;

WriteMakefile(
    NAME              => 'API::DirectAdmin',
    VERSION_FROM      => 'lib/API/DirectAdmin.pm',
    PREREQ_PM         => {
        'Modern::Perl'   => '0',
        'Data::Dumper'   => '0',
        'LWP::UserAgent' => '0',
		'HTTP::Request'  => '0',
		'URI'   		 => '0',
		'Carp'   		 => '0',
    },
    ($] >= 5.005 ?
      (ABSTRACT_FROM  => 'lib/API/DirectAdmin.pm',
       AUTHOR         => 'Andrey "Chips" Kuzmin <chipsoid@cpan.org>') : ()),
);

README  view on Meta::CPAN

   perl Makefile.PL
   make
   make test
   make install

DEPENDENCIES

This module requires these other modules and libraries:
  Modern::Perl
  LWP::UserAgent
  HTTP::Request
  URI
  Carp 
  Data::Dumper

COPYRIGHT AND LICENCE

Copyright (C) 2012 by Andrey "Chips" Kuzmin <chipsoid@cpan.org>

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.1 or,

lib/API/DirectAdmin.pm  view on Meta::CPAN

package API::DirectAdmin;

use Modern::Perl '2010';
use LWP::UserAgent;
use HTTP::Request;
use Data::Dumper;
use Carp;
use URI;

our $VERSION = 0.09;
our $DEBUG   = '';
our $FAKE_ANSWER = '';

# for init subclasses
init_components(

lib/API/DirectAdmin.pm  view on Meta::CPAN

    my ( $self, $method, $url, $params ) = @_;
    
    unless ( $method ~~ [ qw( POST GET ) ] ) {
        confess "Unknown request method: '$method'";
    }

    confess "URL is empty" unless $url;

    my $content;
    my $ua = LWP::UserAgent->new;
    my $request = HTTP::Request->new( $method, $url );
    
    if ( $method eq 'GET' ) {
	my $response = $ua->request( $request );
	$content = $response->content;
    }
    else { # Temporary URL for making request
	my $temp_uri = URI->new('http:');
	$temp_uri->query_form( $params );
	$request->content( $temp_uri->query );
	$request->content_type('application/x-www-form-urlencoded');

lib/API/DirectAdmin.pm  view on Meta::CPAN

   perl Makefile.PL
   make
   make test
   make install

=head1 DEPENDENCIES

This module requires these other modules and libraries:
  Modern::Perl
  LWP::UserAgent
  HTTP::Request
  URI
  Carp 
  Data::Dumper

=head1 COPYRIGHT AND LICENCE

Copyright (C) 2012-2013 by Andrey "Chips" Kuzmin <chipsoid@cpan.org>

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.1 or,



( run in 0.468 second using v1.01-cache-2.11-cpan-4505f990765 )