Jayon / weibo4j

Automatically exported from code.google.com/p/weibo4j
Other
0 stars 0 forks source link

Failed in User.constructUser #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
To get Follower/Friends information with parameter count, the method will 
call User.constructUsers like 

 700                 return User.constructUsers(get(getBaseURL() + "statuses/friends.json",
 701                                 new PostParameter[]{new PostParameter("id",id),new PostParameter("cursor",cursor),new PostParameter("count"     ,count)} , true));
 702         }
in User.java, it will throw an exception with following error message: 

weibo4j.WeiboException: A JSONArray text must start with '[' at character 
1:{"users":[{"id":18 ...
        at weibo4j.http.Response.asJSONArray(Response.java:212)
        at weibo4j.User.constructUsers(User.java:377)
        at weibo4j.Weibo.getFriendsStatuses(Weibo.java:697)
        at com.phistory.microblog.util.GetFriends.main(GetFriends.java:52)
Caused by: weibo4j.org.json.JSONException: A JSONArray text must start with '[' 
at character 1
        at weibo4j.org.json.JSONTokener.syntaxError(JSONTokener.java:413)
        at weibo4j.org.json.JSONArray.<init>(JSONArray.java:114)
        at weibo4j.org.json.JSONArray.<init>(JSONArray.java:158)
        at weibo4j.http.Response.asJSONArray(Response.java:210)
        ... 3 more
As a work around, I have to use User.constructUser() instead. 

Original issue reported on code.google.com by everex....@gmail.com on 29 Aug 2011 at 2:38

GoogleCodeExporter commented 9 years ago
OK,收到。晚些我会更新。不好意思。

Original comment by haidong...@gmail.com on 30 Aug 2011 at 3:02