【问题标题】:"Sorry, an error occurred while processing this request" instagram api python-instagram“抱歉,处理此请求时出错” instagram api python-instagram
【发布时间】:2014-01-11 12:11:40
【问题描述】:

我正在使用 python-instagram 库来访问 instagram api。但是当我运行我的应用程序(flask rest api 应用程序)时,我使用 InstagramAPI 和 get_authorize_login_url 方法的身份验证方法引发 500 错误:

raise OAuth2AuthExchangeError("The server returned a non-200 response for URL %s %s %s" % (url, response['status'], content))
OAuth2AuthExchangeError: The server returned a non-200 response for URL https://api.instagram.com/oauth/authorize?scope=basic&redirect_uri=http%3A%2F%2Fsocialservice.test.5-soft.com%3A8515%2Finstagram%2Fauth&response_type=code&client_id=c5095d88cee14bac91a9341e6e82ff8f 500  Sorry, an error occurred while processing this request. 

在我的本地机器上它可以正常工作,但在具有不同 IP 的生产服务器中我遇到了这个问题。 如果有人可以帮助我解决这个问题,我将非常感激

提前致谢, 罗恩

【问题讨论】:

    标签: api instagram


    【解决方案1】:

    请澄清:

    在我的本地机器上它可以正常工作,但在具有不同 IP 的生产服务器中我遇到了这个问题。

    如何在本地计算机上执行授权? Instagram 的 API 需要 redirect_uri 的公共 URL。


    接下来,我还没有找到任何证据来验证这一点,但我不相信你可以在回调 url 中指定自定义端口(你提供了http://socialservice.test.5-soft.com:8515/instagram/auth)。


    最后,假设问题出在您的回调服务器上,当您没有将正确的响应返回给 Instagram 时,通常会发生该错误。服务器需要GET参数code的值作为明文回显。

    如果我浏览到这里:http://socialservice.test.5-soft.com:8515/instagram/auth?code=test 我没有得到任何响应,这可能是您的错误的原因。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-13
      • 1970-01-01
      • 2013-04-19
      • 2015-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多