Net::Groonga::HTTP;
use 5.008005;
use strict;
use warnings;
our $VERSION = "0.03";
use JSON::XS qw(encode_json);
use Furl;
use URI;
use Net::Groonga::HTTP::Response;
use Mouse;
has end_point => (
ll($function, %args);
};
}
sub load {
my ($self, %args) = @_;
$args{values} = encode_json($args{values}) if ref $args{values};
return $self->call('load', %args);
}
1;
__END__
=encod
,
values => \@values,
);
Load the data to database. This method encodes I<values> to JSON automatically, if it's arrayref.
=item $groonga->select(%args)
=item $groonga->status(%args)
=
package Net::Groonga::HTTP::Response;
use strict;
use warnings;
use utf8;
use JSON::XS qw(decode_json);
use Data::Page;
use Net::Groonga::Pager;
use Mouse;
has function => (
is => 'rw',
requ
e->code ne 200;
return $self->http_response->content if $self->function eq 'dump';
decode_json($self->http_response->content);
}
sub return_code {
my $self = shift;
Carp::croak(sprint
ethods return method dies if the response is not I<200 OK>.
=over 4
=item $res->data() :Object
JSON decoded content body.
=item $res->return_code() :Int
Shorthand for C<< $res->data->[0]->[0] >>.