【发布时间】:2015-06-02 16:26:43
【问题描述】:
我正在尝试使用 json 解析 Facebook 提要
显示这个错误
06-02 16:53:33.112: D/ee:(29180): java.lang.IllegalArgumentException: 索引 77 处查询中的非法字符: https://graph.facebook.com/331394590231184/feed?access_token=******&client_id=**&client_secret=*****?
我使用代码:
private static String url = "https://graph.facebook.com/331394590231184/feed?access_token=**|*****&client_id=***&client_secret=****";
JSONParser jParser = new JSONParser();
List<NameValuePair> params = new ArrayList<NameValuePair>();
JSONObject json = jParser.makeHttpRequest(url, "GET", params);
JSONArray data = json.getJSONArray("data");
JSONParser 代码:
static InputStream is = null;
DefaultHttpClient httpClient = new DefaultHttpClient();
String paramString = URLEncodedUtils.format(params, "utf-8");
url += "?" + paramString;
HttpGet httpGet = new HttpGet(url);
HttpResponse httpResponse = httpClient.execute(httpGet);
HttpEntity httpEntity = httpResponse.getEntity();
is = httpEntity.getContent();
【问题讨论】:
-
在这里将您的访问令牌放在一个问题中可能不是一个好主意。
标签: java android facebook facebook-graph-api