0

我正在向foursquare api调用一个多请求,如下所示:

 https://api.foursquare.com/v2/multi?%2Fvenues%2Fsearch%3Fll%3D33.859868%2C-117.886133%26query%3DTarget,%2Fvenues%2Fsearch%3Fll%3D33.859868%2C-117.886133%26query%3DNordstrom&intent=browse&radius=16093&oauth_token=WS10PQFRUXACDDIJMN3JEEIHFOPA1UTMRZP0E41MWAF0HHJL&v=20130419

oAuth 令牌是向公众开放的通用使用令牌

我正在使用以下 java 代码创建 url:

 String baseUrl  = "https://api.foursquare.com/v2";
    String action = "/multi?";
    String request1 = "/venues/search?ll=33.859868,-117.886133&query=Target";
    String requestEnc1 = URLEncoder.encode(request1);
    String request2 = "/venues/search?ll=33.859868,-117.886133&query=Nordstrom";
    String requestEnc2 = URLEncoder.encode(request2);
    String commonParams = "&intent=browse&radius=16093&oauth_token=WS10PQFRUXACDDIJMN3JEEIHFOPA1UTMRZP0E41MWAF0HHJL&v=20130419";

我收到了 400 个错误请求。但是,这看起来类似于此处文档中的示例:

 https://developer.foursquare.com/docs/multi/multi

url的构造方式有问题吗?

4

1 回答 1

1

如果您在浏览器中打开该 URL,您会看到 Foursquare 返回的错误消息是errorDetail: "Must provide parameter requests". 您没有正确构建调用:https ://developer.foursquare.com/docs/multi/multi

于 2013-04-19T18:55:28.890 回答