File Coverage

blib/lib/OpenID/Lite/RelyingParty/DirectCommunication.pm
Criterion Covered Total %
statement 12 21 57.1
branch 0 2 0.0
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 16 29 55.1


line stmt bran cond sub pod time code
1             package OpenID::Lite::RelyingParty::DirectCommunication;
2              
3 1     1   7 use Any::Moose;
  1         2  
  1         10  
4             with 'OpenID::Lite::Role::AgentHandler';
5             with 'OpenID::Lite::Role::ErrorHandler';
6              
7 1     1   730 use HTTP::Request;
  1         2  
  1         15  
8 1     1   65 use OpenID::Lite::Message;
  1         2  
  1         7  
9              
10             sub send_request {
11 0     0 0   my ( $self, $url, $params ) = @_;
12 0           my $req = HTTP::Request->new( POST => $url );
13 0           $req->header( 'Content-Type' => q{application/x-www-form-urlencoded} );
14 0           $req->content( $params->to_post_body );
15 0           my $res = $self->agent->request($req);
16 0 0         if ($res->is_success) {
17 0           my $params = OpenID::Lite::Message->from_key_value($res->content);
18 0           return $params;
19             }
20 0           return $self->ERROR($res->status_line);
21             }
22              
23 1     1   180 no Any::Moose;
  1         3  
  1         15  
24             __PACKAGE__->meta->make_immutable;
25             1;
26