【发布时间】: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 += @"&locations=" + location;
位置变量的值在哪里
-121.75,36.8,-122.75,37.8
所以我最终得到的查询看起来像这样
https://stream.twitter.com/1/statuses/filter.json?track=twitter%2Cfacebook%2Ciphone&locations=-121.75,36.8,-122.75,37.8
我收到 406 Not Acceptable 响应,有什么想法吗?
【问题讨论】:
-
&用于分隔参数。不要逃避它。你的网址应该是这样的https://stream.twitter.com/1/statuses/filter.json?track=twitter%2Cfacebook%2Ciphone&locations=-121.75,36.8,-122.75,37.8