gpt4 book ai didi

java - foursquare 多请求收到 400 错误请求

转载 作者:行者123 更新时间:2023-12-01 14:39:37 24 4
gpt4 key购买 nike

我正在对 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 token 是向公众开放的通用 token

我使用以下 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的构造方式有问题吗?

最佳答案

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

关于java - foursquare 多请求收到 400 错误请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16111522/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com