【问题标题】:Reddit More Children APIReddit 更多儿童 API
【发布时间】:2016-04-24 05:36:28
【问题描述】:

我有一个使用 Guzzle 和 Reddits json api 获取 reddit cmets 的网站。虽然它往往很慢,但它可以工作,但我在尝试通过 /api/morechildren.json 端点加载更多孩子时遇到了问题。

在尝试生更多孩子时,我总是收到 403 禁止错误。这些是我正在使用的参数,包括我正在访问的数据和端点。

array(2) {
  ["request"]=>
  string(44) "https://www.reddit.com/api/morechildren.json"
  ["data"]=>
  array(6) {
    ["link_id"]=>
    string(10) "t3_cz36xw7"
    ["id"]=>
    string(10) "t1_cz361ai"
    ["depth"]=>
    string(1) "1"
    ["children"]=>
    string(7) "cz36xw7"
    ["sort"]=>
    string(10) "confidence"
    ["api_type"]=>
    string(4) "json"
  }
}

你可以在这里看到我试图点击的 api:https://www.reddit.com/dev/api/oauth#GET_api_morechildren

无论我尝试什么,我都会得到 'string(116) "Client error response [url] https://www.reddit.com/api/morechildren.json [status code] 403 [reason phrase] Forbidden"'

有什么想法吗?

【问题讨论】:

    标签: php api reddit


    【解决方案1】:

    需要身份验证。 OAuth 是授权库,但如果没有 3rd 方库,则很难使用。看https://github.com/OAuthSwift/OAuthSwift,不错的授权库,好用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-19
      • 1970-01-01
      • 1970-01-01
      • 2019-04-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-06
      相关资源
      最近更新 更多