betfair/Request.pm

filter: Statementstmt 59.0% 13 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 64.2% 18 / 28 CC 1 SCAR 1.8
CC
1
Cov
59%
new_request
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« betfair/TypeCheck.pm ↑ Summary
1 package WWW::betfair::Request;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use LWP::UserAgent;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use HTTP::Request;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head2 new_request
8  
9 Sends HTTP requests to the betfair API and parses the returning XML into a Perl hashreference.
10
11 =cut
12  
13  
14 sub new_request
15 0 ▶{
Subroutine new_request: not called CC=1 SCAR=6.9
Pod documented
16 0 my ($uri, $action, $xmlmessage) = @_;
17
18 # build and send request
19 0 my $userAgent = LWP::UserAgent->new;
20 0 $userAgent->env_proxy;
21 0 my $request = HTTP::Request->new( POST => $uri );
22 0 $request->header( SOAPAction => '"' . $action .'"' );
23 0 $request->header(Accept_Encoding => "gzip");
24 0 $request->content($xmlmessage);
25 0 $request->content_type("text/xml; charset=utf-8");
26 0 return $userAgent->request($request);
27 }
28 2 1;
« betfair/TypeCheck.pm ↑ Summary