【问题标题】:Linq-to-Twitter: remote server returned an error: (410) GoneLinq-to-Twitter:远程服务器返回错误:(410) Gone
【发布时间】:2013-06-15 00:57:22
【问题描述】:

我正在尝试让 Linq-to-Twitter 发布推​​文。我的代码基于来自http://linqtotwitter.codeplex.com/wikipage?title=LINQ%20to%20Twitter%20Samples&referringTitle=Home的Linq2Twitter WebFormsTweetsDemo

应用程序验证正常 - 我正在使用 ASP.NET 开发服务器在 localhost 上运行示例。

但以下发布推文的代码失败:

var auth = new WebAuthorizer
{
      Credentials = new SessionStateCredentials()
};


var tweet = twitterCtx.UpdateStatus("Linqtowtwitter is working");

但是,上面的 UpdateStatus 调用返回“远程服务器返回错误:(410) Gone”。根据 Fiddler 的说法,没有向 twitter 发送请求。

【问题讨论】:

    标签: linq-to-twitter


    【解决方案1】:

    听起来您使用的是旧版本的 LINQ to Twitter。 Twitter 最近关闭了 Twitter API v1.0,您现在应该使用 Twitter API v1.1。以下是弃用公告:

    https://dev.twitter.com/blog/api-v1-is-retired

    您应该升级到最新版本的 LINQ to Twitter。此外,Twitter API v1.1 在所有端点上都需要 OAuth。首次使用 OAuth 时,经常会遇到 401 Unauthorized 错误。为了帮助解决这些错误,我编写了一个常见问题解答:https://linqtotwitter.codeplex.com/wikipage?title=LINQ%20to%20Twitter%20FAQ&referringTitle=Documentation

    注意:Twitter 已经进行了大约 9 个月的停电和公告,自第一次弃用公告以来,我一直在推特上发布 @JoeMayo。 p>

    【讨论】:

    • 不要以为是老版本——使用的是Linq to Twitter的2.0.27版本——那是代码示例打包的版本。
    • OK 我发现样本使用的是 1.0 API。我升级了,它已经破坏了代码 - 将测试并报告
    • 可下载的源代码有演示项目。下载页面上还有一个控制台演示项目。文档也几乎是最新的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-10-10
    • 1970-01-01
    • 2013-04-17
    • 2011-09-10
    • 1970-01-01
    • 2013-01-01
    • 1970-01-01
    相关资源
    最近更新 更多