使用Foursquare API的400错误请求 [英] 400 Bad Request with Foursquare API
本文介绍了使用Foursquare API的400错误请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将签到发布到4sq,但仍然收到400错误请求.这是执行签入的非常简单的代码:
I am posting a checkin to 4sq but keep getting 400 Bad Request. Here is a very simple code that does the checkin:
client = new WebClient();
client.UploadStringCompleted += (s, args) =>
{
var result = args.Result;
};
client.UploadStringAsync(new Uri("https://api.foursquare.com/v2/checkins/add/?oauth_token=my_token"),
"POST", "venueId=venue_id");
我确定my_token和场所ID是正确的,因为我使用它们来获取以前的签到清单和场所信息.
I am sure my_token and venue_id is correct because I use them for getting list of previous checkins and venue information.
您看到此代码有什么问题吗?
Do you see something wrong with this code?
谢谢.
推荐答案
将oauth_token指定为POST参数,而不是URL路径的一部分.
Specify the oauth_token as a POST param, not part of the URL path.
这篇关于使用Foursquare API的400错误请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文