sts into stash. Then, Extends with Class::Trigger!
=head1 SYNOPSIS
use Stash::REST;
use JSON;
$obj = Stash::REST->new(
do_request => sub {
my $req = shift;
},
decode_response => sub {
my $res = shift;
return decode_json($res->content);
}
);
# you can write/read stash anytime
$obj->stash('foo') #
u can use this to modify the default HTTP::Request::Common header for $data
# POST body with JSON:
$obj->rest_post(
'/post-with-params?api_key=1',
stash => 'testparams',