php - Oauth 1.0 只返回一项
问题描述
我在 php 中使用 oauth 1.0 从 API 获取 json。我知道事实上有不止一件物品要退回,但我只得到一件。这是getLastResponse()
问题所在还是可能是什么?我想返回整个 json 对象。
private function getEvents() {
try {
$oauth = new OAuth($this->oauth_Key, $this->oauth_consumer, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_AUTHORIZATION);
$oauth->fetch($this->api_url);
$response_info = $oauth->getLastResponseInfo();
header("Content-Type: {$response_info["content_type"]}");
echo $oauth->getLastResponse();
} catch(OAuthException $e) {
echo "Exception caught!\n";
echo "Response: ". $e->lastResponse . "\n";
}
}
解决方案
推荐阅读
- git - 在等待审阅者合并拉取请求时,我应该从分支分支吗?
- javascript - 试图调用 2 个 JS 文件,但只有 1 个有效
- javascript - 如何在反应js javascript中映射这个给定的api响应
- r - 二进制运算符错误的Sjplot非数字参数?
- sql - 查找数据集中每年可用的每个国家/地区的前 2 个供应商?- 大查询 SQL
- android - vivo杀死应用程序时不接收广播
- kubernetes - Tekton 仪表板部署错误-来自服务器的错误(禁止):创建“config/service.yaml”时出错
- android - Flutter 使用 Cloud Firestore 和 Firebase Auth 存储用户数据
- visual-studio-code - 如何在 VS Code 1.57 中禁用工作区信任?
- r - 如何使用 lapply 遍历 ggplot2 中的 2 个变量