新浪API获取签到数据Java jsonobject错误 100
publicclassPOIbynearbyTimeline{publicstaticvoidmain(String[]args){Stringaccess_token=...
public class POIbynearbyTimeline {
public static void main(String[] args){
String access_token = "已填";
Map<String, String> map=new HashMap<String, String>();
Place p = new Place(access_token);
BigDecimal b1 = new BigDecimal(25.03639);
BigDecimal b2 = new BigDecimal(102.70861);
map.put("lat", b1.toString());
map.put("long", b2.toString());
map.put("range","1000");
map.put("starttime","1325347200");
map.put("endtime","1325347200");
map.put("page", "1");
try {
StatusWapper sw = p.nearbyTimeLine(map);
Log.logInfo(sw.toString());
} catch (WeiboException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
}
提示的错误信息是
weibo4j.model.WeiboException: A JSONObject text must begin with '{' at character 1:[]
at weibo4j.http.Response.asJSONObject(Response.java:201)
at weibo4j.model.Status.constructWapperStatus(Status.java:263)
at weibo4j.Place.nearbyTimeLine(Place.java:182)
at my.POIbynearbyTimeline.main(POIbynearbyTimeline.java:26)
Caused by: weibo4j.org.json.JSONException: A JSONObject text must begin with '{' at character 1
at weibo4j.org.json.JSONTokener.syntaxError(JSONTokener.java:410)
at weibo4j.org.json.JSONObject.<init>(JSONObject.java:179)
at weibo4j.org.json.JSONObject.<init>(JSONObject.java:402)
at weibo4j.http.Response.asJSONObject(Response.java:199)
... 3 more
求解。。。。。 展开
public static void main(String[] args){
String access_token = "已填";
Map<String, String> map=new HashMap<String, String>();
Place p = new Place(access_token);
BigDecimal b1 = new BigDecimal(25.03639);
BigDecimal b2 = new BigDecimal(102.70861);
map.put("lat", b1.toString());
map.put("long", b2.toString());
map.put("range","1000");
map.put("starttime","1325347200");
map.put("endtime","1325347200");
map.put("page", "1");
try {
StatusWapper sw = p.nearbyTimeLine(map);
Log.logInfo(sw.toString());
} catch (WeiboException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
}
提示的错误信息是
weibo4j.model.WeiboException: A JSONObject text must begin with '{' at character 1:[]
at weibo4j.http.Response.asJSONObject(Response.java:201)
at weibo4j.model.Status.constructWapperStatus(Status.java:263)
at weibo4j.Place.nearbyTimeLine(Place.java:182)
at my.POIbynearbyTimeline.main(POIbynearbyTimeline.java:26)
Caused by: weibo4j.org.json.JSONException: A JSONObject text must begin with '{' at character 1
at weibo4j.org.json.JSONTokener.syntaxError(JSONTokener.java:410)
at weibo4j.org.json.JSONObject.<init>(JSONObject.java:179)
at weibo4j.org.json.JSONObject.<init>(JSONObject.java:402)
at weibo4j.http.Response.asJSONObject(Response.java:199)
... 3 more
求解。。。。。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询