6ba-e579c2d3230a";
my $json = eval { require JSON::XS; JSON::XS:: } || do { require JSON::PP; JSON::PP:: };
$json = $json->new->utf8;
$json->boolean_values (0, 1)
if $json->can ("boolean_values")
=> { "content-type" => "application/json; charset=utf-8", "cache-control" => "no-cache" },
sub {
my ($res, $hdr) = @_;
$res = eval { $json->decode ($res) };
$hdr->{S
p, undef, $cb)
}
sub post_ {
my ($self, $ep, $data, $cb) = @_;
$self->req_ (POST => $ep, $json->encode ($data || {}), $cb)
}
sub delete_ {
my ($self, $ep, $cb) = @_;
$self->req_ (DELET