gpt4 book ai didi

python - 调用 Reddit API 时出现 403 错误。

转载 作者:太空宇宙 更新时间:2023-11-04 06:13:09 27 4
gpt4 key购买 nike

我正在尝试访问用户保存的数据。它不断返回 403 错误,这是它的 api 端点。

http://www.reddit.com/dev/api#GET_user_ {用户名}_saved

我完全不知道应该在我的 header 中发送什么来使这个请求有效,reddit 文档根本没有提到它。帮忙?

我正在使用 Python 请求库来执行此操作。

最佳答案

引用 listingcontroller.py ( here ) 中 reddit 代码的第 686 行:

    if (where in ('saved', 'hidden') and not 
((c.user_is_loggedin and c.user._id == vuser._id) or
c.user_is_admin)):
return self.abort403()

您可以清楚地看到,您必须以用户名 身份登录或成为管理员才能获取已保存隐藏 数据 -否则你会得到一个 403 错误

关于python - 调用 Reddit API 时出现 403 错误。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17503827/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com