nds qw(JMAP::Tester);
has +json_codec => (
is => 'bare',
handles => {
json_encode => 'encode',
json_decode => 'decode',
},
default => sub {
require JSON;
# Not ->utf8-> or we
# Maybe to be fixed in Protocol::WebSocket? Or IO::Async is doing this
# for us?
return JSON->new->convert_blessed;
},
);
has 'ws_api_uri' => (
is => 'rw',
required => 1,
);
est->{'@type'} = 'Request';
my $json = $self->json_encode($request);
my $client = $self->_cached_client || $self->connect_ws;
$client->send_text_frame($json);
my $res = $self->loop->run;