line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::Snooze; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
48759
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
75
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
81
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.01_02'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
1137
|
use WWW::Snooze::Request; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
145
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub request { |
11
|
0
|
|
|
0
|
1
|
|
WWW::Snooze::Request->new(@_); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
1; |
15
|
|
|
|
|
|
|
=head1 NAME |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
WWW::Snooze - Simple RESTful API |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Using HTTP::Headers to override pieces of the request, REST operations can be |
22
|
|
|
|
|
|
|
performed like so: |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
use WWW::Snooze; |
25
|
|
|
|
|
|
|
use WWW::Snooze::Serialize::JSON; |
26
|
|
|
|
|
|
|
use HTTP::Headers; |
27
|
|
|
|
|
|
|
use Data::Dumper; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my $api = WWW::Snooze::request( |
30
|
|
|
|
|
|
|
'https://agilezen.com/api/v1', |
31
|
|
|
|
|
|
|
headers => HTTP::Headers->new( |
32
|
|
|
|
|
|
|
'X-Zen-ApiKey' => 'key' |
33
|
|
|
|
|
|
|
), |
34
|
|
|
|
|
|
|
serializer => WWW::Snooze::Serialize::JSON->new( |
35
|
|
|
|
|
|
|
extension => '' |
36
|
|
|
|
|
|
|
) |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my $tasks = $api->projects(40075)->stories; |
40
|
|
|
|
|
|
|
print Dumper($tasks->get()); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $hdr = HTTP::Headers->new(); |
43
|
|
|
|
|
|
|
$hdr->authorization_basic('key', ''); |
44
|
|
|
|
|
|
|
my $chili = WWW::Snooze::request( |
45
|
|
|
|
|
|
|
'http://chili.example.com', |
46
|
|
|
|
|
|
|
headers => $hdr, |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
print Dumper($chili->issues(undef, limit => 1)->get()); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 METHODS |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 request |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Returns an instance of L |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 AUTHOR |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Anthony Johnson Eaj@ohess.orgE |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |