r} . ':' . $self->{pwd}, '')};
$header->{'Content-Type'} = 'application/json' if %params;
my @extra = %params ? (json => \%params) : ();
my $tx = $ua->build_tx($method => $self->{endpoint}
->res->headers->content_type and $tx->res->headers->content_type =~ 'application/json') {
return $tx->res->json;
}
if (!$tx->success) {
$errstr = "Failed to fetch $url: " . $tx