【问题标题】:twitter streaming API location推特流媒体 API 位置
【发布时间】:2012-04-18 18:05:39
【问题描述】:

我正在尝试用 C# 实现一个 twitter 流查看器,我的问题不在于 C# 本身。

我只是在尝试使用 twitter 的流 API 的地理定位功能。我正在尝试以这种形式发送请求

private string url = @"https://stream.twitter.com/1/statuses/filter.json?track=";

然后我附加我的参数

 for (int i = 0; i < keywords.Count; i++)
        {
            url += keywords[i].ToString() + "%2C";
        }

在此之前,查询工作正常,当我添加它时它停止工作

 url += @"&amp;locations=" + location;

位置变量的值在哪里

-121.75,36.8,-122.75,37.8

所以我最终得到的查询看起来像这样

https://stream.twitter.com/1/statuses/filter.json?track=twitter%2Cfacebook%2Ciphone&amp;locations=-121.75,36.8,-122.75,37.8

我收到 406 Not Acceptable 响应,有什么想法吗?

【问题讨论】:

  • &amp; 用于分隔参数。不要逃避它。你的网址应该是这样的https://stream.twitter.com/1/statuses/filter.json?track=twitter%2Cfacebook%2Ciphone&amp;locations=-121.75,36.8,-122.75,37.8

标签: c# twitter


【解决方案1】:

尝试将&amp;amp; 替换为标准与符号。

【讨论】:

    猜你喜欢
    • 2015-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-04
    • 2014-07-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多