Connector
view release on metacpan or search on metacpan
lib/Connector/Proxy/HTTP.pm view on Meta::CPAN
my $req = HTTP::Request->new($self->http_method() => $url);
$self->_init_request( $req );
# set generated content
$req->content($content);
my $response = $self->agent()->request($req);
# error handling
if (!$response->is_success) {
$self->log()->error($response->status_line);
$self->log()->error($response->decoded_content);
die "Unable to upload data to server";
}
$self->log()->debug("Set responded with: " . $response->status_line);
$self->log()->trace($response->decoded_content) if ($self->log()->is_trace());
return 1;
}
sub get_meta {
my $self = shift;
# If we have no path, we tell the caller that we are a connector
my @path = $self->_build_path_with_prefix( shift );
if (scalar @path == 0) {
lib/Connector/Proxy/HTTP.pm view on Meta::CPAN
}
return $filename;
}
sub _parse_result {
my $self = shift;
my $response = shift;
my $res = $response->decoded_content;
chomp $res if ($self->chomp_result());
return $res;
}
no Moose;
__PACKAGE__->meta->make_immutable;
1;
( run in 0.569 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )