bda::HTTP::Client;
use IO::Lambda::HTTP::UserAgent;
use HTTP::Request::Common;
use JSON::XS qw(encode_json decode_json);
sub new
{
my ( $class, %opt ) = @_;
my $self = bless {
profile => 'default
$method = \&HTTP::Request::Common::POST;
$extra{content} = encode_json($content);
$extra{'content-type'} = 'application/json';
}
$options //= {};
lambda {
my $token = $self->config->{token
) unless ref $response;
my $json;
unless ($response->is_success) {
if ( $response->header('content-type') eq 'application/json') {
eval { $json = decode_json($response->content) };
got