File Coverage

blib/lib/WebService/SOP/Auth/V1_1/Request/GET.pm
Criterion Covered Total %
statement 20 20 100.0
branch 4 4 100.0
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 31 31 100.0


line stmt bran cond sub pod time code
1             package WebService::SOP::Auth::V1_1::Request::GET;
2 3     3   49615 use strict;
  3         6  
  3         104  
3 3     3   14 use warnings;
  3         6  
  3         101  
4 3     3   18 use Carp ();
  3         5  
  3         63  
5 3     3   1851 use HTTP::Request::Common qw(GET);
  3         50213  
  3         281  
6 3     3   1566 use WebService::SOP::Auth::V1_1::Util qw(create_signature);
  3         11  
  3         484  
7              
8             sub create_request {
9 7     7 1 11242 my ($class, $uri, $params, $app_secret) = @_;
10              
11 7 100       53 Carp::croak('Missing required parameter: time') if not $params->{time};
12 5 100       20 Carp::croak('Missing app_secret') if not $app_secret;
13              
14 4         21 $uri->query_form({
15             %$params,
16             sig => create_signature($params, $app_secret),
17             });
18 3         449 GET $uri;
19             }
20              
21             1;
22              
23             __END__
24              
25             =encoding utf-8
26              
27             =head1 NAME
28              
29             WebService::SOP::Auth::V1_1::Request::GET
30              
31             =head1 DESCRIPTION
32              
33             To create a valid L<HTTP::Request> object for given C<GET> request parameters.
34              
35             =head1 METHODS
36              
37             =head2 $class->create_request( $uri, $params, $app_secret )
38              
39             Returns L<HTTP::Request> object for a GET request.
40             Request parameters including signature are gathered as GET parameters.
41              
42             =head1 SEE ALSO
43              
44             L<HTTP::Request>
45             L<WebService::SOP::Auth::V1_1>
46              
47             =head1 LICENSE
48              
49             Copyright (C) Research Panel Asia, Inc.
50              
51             This library is free software; you can redistribute it and/or modify
52             it under the same terms as Perl itself.
53              
54             =head1 AUTHOR
55              
56             yowcowvg E<lt>yoko_ohyama [ at ] voyagegroup.comE<gt>
57              
58             =cut
59