Cache-KyotoTycoon
view release on metacpan or search on metacpan
lib/TSVRPC/Client.pm view on Meta::CPAN
);
return bless {furl => $furl, base => $base}, $class;
}
sub call {
my ( $self, $method, $args, $req_encoding ) = @_;
$req_encoding ||= 'B'; # default encoding is base64. because base64 is very fast.
my $content = TSVRPC::Parser::encode_tsvrpc($args, $req_encoding);
my $furl = $self->{furl};
my %special_headers = ('content-type' => undef);
my ( $minor_version, $code, $msg, $headers, $body ) = $furl->request(
url => $self->{base} . $method,
headers => [
"Content-Type" => "text/tab-separated-values; colenc=$req_encoding",
"Content-Length" => length($content),
],
method => 'POST',
content => $content,
special_headers => \%special_headers,
);
my $decoded_body;
if (my $content_type = $special_headers{'content-type'}) {
my $res_encoding = TSVRPC::Util::parse_content_type( $content_type );
$decoded_body = defined($res_encoding) ? TSVRPC::Parser::decode_tsvrpc( $body, $res_encoding ) : undef;
}
return ($code, $decoded_body, $msg);
}
1;
__END__
=head1 NAME
( run in 1.307 second using v1.01-cache-2.11-cpan-524268b4103 )