package Apache::Tika::Async;
use strict;
use Moo 2;
use JSON::XS qw(decode_json);
use File::Temp 'tempfile';
our $VERSION = '0.11';
=head1 NAME
Apache::Tika::Async - connect to Apache Tika
=head1
@_;
$line =~ m!"([^"]+)"!g;
}
sub get_meta {
my( $self, $file )= @_;
#return decode_json($self->fetch( filename => $file, type => 'meta' ));
# Hacky CSV-to-hash decode :-/
return
"Content-Length" => $content_size,
"Accept" => 'application/json,text/plain',
'Content-Type' => 'application/octet-stream',
a::Connection;
use strict;
use Moo::Role;
use JSON::XS;
our $VERSION = '0.11';
sub decode_response {
my( $self, $body ) = @_;
return decode_json( $body );
}
sub process_response {
my (
nd $code <= 209 ) {
if ( defined $body and length $body ) {
# Let's hope it's JSON
$body = $self->decode_response($body)
if $is_encoded;
ret