| 1 | package Net::Azure::EventHubs::Request; | ||||||||||
| 2 | 7 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 7 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 7 | ▶ | use parent 'HTTP::Request'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 7 | ▶ | use Net::Azure::EventHubs::Response; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 7 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | use Class::Accessor::Lite ( | ||||||||||
| 10 | 7 | new => 0, | |||||||||
| 11 | rw => [qw[agent]], | ||||||||||
| 12 | 7 | ▶ | ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | sub do { | ||||||||||
| 15 | 4 | ▶ | my $self = shift; | ||||||||
|
Subroutine
do: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 16 | 4 | my $res = $self->agent->request($self); | |||||||||
| 17 | 4 | ▶ | croak $res->status_line if !$res->is_success; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 3 | bless $res, 'Net::Azure::EventHubs::Response'; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 7 | 1; | |||||||||
| 22 | |||||||||||
| 23 | =encoding utf-8 | ||||||||||
| 24 | |||||||||||
| 25 | =head1 NAME | ||||||||||
| 26 | |||||||||||
| 27 | Net::Azure::EventHubs::Request - A Request Class for Net::Azure::EventHubs | ||||||||||
| 28 | |||||||||||
| 29 | =head1 SYNOPSIS | ||||||||||
| 30 | |||||||||||
| 31 | use Net::Azure::EventHubs::Request; | ||||||||||
| 32 | use LWP::UserAgent; | ||||||||||
| 33 | my $req = Net::Azure::EventHubs::Request->new(GET => 'http://...'); | ||||||||||
| 34 | $req->agent(LWP::UserAgent->new); | ||||||||||
| 35 | my $res = $req->do; | ||||||||||
| 36 | |||||||||||
| 37 | =head1 DESCRIPTION | ||||||||||
| 38 | |||||||||||
| 39 | Net::Azure::EventHubs::Request is a request class for Net::Azure::EventHubs. | ||||||||||
| 40 | |||||||||||
| 41 | It inherits HTTP::Request. | ||||||||||
| 42 | |||||||||||
| 43 | =head1 METHODS | ||||||||||
| 44 | |||||||||||
| 45 | =head2 new | ||||||||||
| 46 | |||||||||||
| 47 | A constructor method. | ||||||||||
| 48 | |||||||||||
| 49 | =head2 agent | ||||||||||
| 50 | |||||||||||
| 51 | my $agent = LWP::UserAgent->new(...); | ||||||||||
| 52 | $req->agent($agent); | ||||||||||
| 53 | |||||||||||
| 54 | An accessor for setting/getting a LWP::UserAgent object | ||||||||||
| 55 | |||||||||||
| 56 | =head2 do | ||||||||||
| 57 | |||||||||||
| 58 | my $res = $req->do; | ||||||||||
| 59 | |||||||||||
| 60 | Do itself as http/https request with agent. Then returns a response object. | ||||||||||
| 61 | |||||||||||
| 62 | =head1 LICENSE | ||||||||||
| 63 | |||||||||||
| 64 | Copyright (C) ytnobody. | ||||||||||
| 65 | |||||||||||
| 66 | This library is free software; you can redistribute it and/or modify | ||||||||||
| 67 | it under the same terms as Perl itself. | ||||||||||
| 68 | |||||||||||
| 69 | =head1 AUTHOR | ||||||||||
| 70 | |||||||||||
| 71 | ytnobody E<lt>ytnobody@gmail.comE<gt> | ||||||||||
| 72 | |||||||||||
| 73 | =cut | ||||||||||
| 74 | |||||||||||