File Coverage

blib/lib/WebService/DS/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::DS::SOP::Auth::V1_1::Request::GET;
2 3     3   79807 use strict;
  3         18  
  3         85  
3 3     3   15 use warnings;
  3         8  
  3         68  
4 3     3   36 use Carp ();
  3         6  
  3         70  
5 3     3   558 use HTTP::Request::Common qw(GET);
  3         19224  
  3         165  
6 3     3   468 use WebService::DS::SOP::Auth::V1_1::Util qw(create_signature);
  3         19  
  3         445  
7              
8             sub create_request {
9 7     7 1 13761 my ($class, $uri, $params, $app_secret) = @_;
10              
11 7 100       52 Carp::croak('Missing required parameter: time') if not $params->{time};
12 5 100       21 Carp::croak('Missing app_secret') if not $app_secret;
13              
14 4         22 $uri->query_form({
15             %$params,
16             sig => create_signature($params, $app_secret),
17             });
18 3         555 GET $uri;
19             }
20              
21             1;
22              
23             __END__
24              
25             =encoding utf-8
26              
27             =head1 NAME
28              
29             WebService::DS::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::DS::SOP::Auth::V1_1>
46              
47             =head1 LICENSE
48              
49             Copyright (C) dataSpring, Inc.
50             Copyright (C) Research Panel Asia, Inc.
51              
52             This library is free software; you can redistribute it and/or modify
53             it under the same terms as Perl itself.
54              
55             =head1 AUTHOR
56              
57             yowcow E<lt>yoko.oyama [ at ] d8aspring.comE<gt>
58              
59             =cut
60