File Coverage

blib/lib/XML/RPC/CustomUA.pm
Criterion Covered Total %
statement 11 20 55.0
branch 0 6 0.0
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 16 32 50.0


line stmt bran cond sub pod time code
1             package XML::RPC::CustomUA;
2 1     1   56489 use base qw(XML::RPC);
  1         2  
  1         304  
3              
4 1     1   8827 use 5.010;
  1         5  
5 1     1   7 use strict;
  1         3  
  1         27  
6 1     1   6 use warnings;
  1         3  
  1         242  
7              
8             our $VERSION = 0.91;
9              
10             sub call {
11 0     0 1   my $self = shift;
12 0           my ( $methodname, @params ) = @_;
13              
14 0 0         die 'no url' if ( !$self->{url} );
15              
16 0           my $xml_out = $self->create_call_xml( $methodname, @params );
17              
18 0           $self->{xml_out} = $xml_out;
19              
20             my ( $result, $xml_in ) = $self->{tpp}->parsehttp(
21             POST => $self->{url},
22             $xml_out,
23             {
24             'Content-Type' => 'text/xml',
25 0 0         'User-Agent' => defined($self->{tpp}->{'User-Agent'}) ? $self->{tpp}->{'User-Agent'} : 'XML-RPC/' . $VERSION,
26             'Content-Length' => length($xml_out)
27             }
28             );
29              
30 0           $self->{xml_in} = $xml_in;
31              
32 0           my @data = $self->unparse_response($result);
33 0 0         return @data == 1 ? $data[0] : @data;
34             }
35              
36              
37             # Preloaded methods go here.
38              
39             # Autoload methods go after =cut, and are processed by the autosplit program.
40              
41             1;
42             __END__