1
我目前正在努力使這項工作:如何使用Mojo :: UserAgent向Oauth授權請求?
my $ua = Mojo::UserAgent->new;
my $req = Mojo::Message::Request->new;
my $tx = $ua->build_tx(GET => 'https://spreadsheets.google.com/feeds/spreadsheets/private/full');
app->log->info($c->session('token'));
$tx->req->headers->authorization('Bearer ' . $c->session('token'));
其中$c->session('token')
是我通過Mojolicious::Plugin::OAuth2得到令牌。
我只收回一個空的答覆。通過捲曲做同樣的(我認爲)工程確定:
curl -v -H "authorization: Bearer the_same_token_as_above" https://spreadsheets.google.com/feeds/spreadsheets/private/full
我在做什麼錯?