因此,使用OAuth API我需要检索access_token属性。发送登录信息工作正常,我确实得到一个适当的回应。响应的格式为这样:Android httpreponse(urlencoded字符串)获取属性
access_token=SOMETOKEN&login=SOMELOGIN&apiKey=SOMEAPIKEY
目前我得到的回应是这样的:
org.apache.http.HttpResponse response = httpclient.execute(httppost);
String content = convertStreamToString(response.getEntity().getContent());
其中所描述的第二行获取内容的字符串。所以返回的是一个URL编码字符串,我需要获取它的access_token值。然而,我不知道如何做到这一点,我似乎无法找到一种方法或任何这样做,我必须解析它或有其他一些方法来做到这一点吗?
任何帮助,非常感谢。
不,我不需要解码它,我需要得到一个字符串的具体参数,可能看起来像︰access_token = n6hfcq3iio&login = username&apiKey = duksqmo98f所以我需要提取的是n6hfcq3iio – AzaraT 2012-03-07 17:20:35
检查我的答案 – Maragues 2012-03-07 18:16:04