【发布时间】:2021-03-27 23:09:51
【问题描述】:
我想使用 Publons 的 API。他们提到了"Any other requests should include a token in the Authorization HTTP header and prefixed with 'Token'. 所以,我尝试在标题中设置Token。这是我的代码
$client = new Client([
'base_uri' => "https://publons.com/api/v2/academic/",
'headers' => [
'Token' => "MyToken"
]
]);
结果是{"detail":"Authentication credentials were not provided."}。我确保令牌是正确的,因为我已经在 Talend API Tester 上尝试过它并且工作正常。谁能帮我?哪里错了?
【问题讨论】:
标签: php http-headers guzzle