}
elsif ($tx->res->headers->content_type =~ m!^(application/json|text/javascript)(;\s*charset=\S+)?$!) {
$data = $tx->res->json;
}
else {
$data = Mojo::Parameters->new($tx->res->body)
head1 ADDITIONAL HELPERS
=head2 oauth2.process_tx
This helper is usefull for processing any API json response:
my $tx = $c->app->ua->get($profile_url); # blocking example
my ($data, $err) = $c-