use PerlX::Maybe;
use WWW::BackpackTF::Currency;
use WWW::BackpackTF::Item;
use WWW::BackpackTF::User;
use PerlX::Maybe;
use WWW::BackpackTF::Currency;
use WWW::BackpackTF::Item;
use WWW::BackpackTF::User;
sub request {
my ($self, $url, %params) = @_;
$params{key} = $self->{key} if $self->{key};
$url = $self->{base} . $url;
$url .= "&$_=$params{$_}" for keys %params;
sub request {
my ($self, $url, %params) = @_;
$params{key} = $self->{key} if $self->{key};
$url = $self->{base} . $url;
$url .= "&$_=$params{$_}" for keys %params;
- my $response = decode_json(get $url)->{response};
- die $response->{message} unless $response->{success};
+ my $htr = $ht->get($url);
+ die $htr->{reason} unless $htr->{success}; ## no critic (RequireCarping)
+ my $response = decode_json($htr->{content})->{response};
+ die $response->{message} unless $response->{success}; ## no critic (RequireCarping)
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.18.2 or,
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.18.2 or,