Code example for JSONObject

Methods: getInt, getString

0
                file = params.getValue(key);
                params.remove(key);
            } 
        } 
        if (TextUtils.isEmpty(file)) {
            rlt = openUrl(context, url, method, params, null, token);
        } else { 
            rlt = openUrl(context, url, method, params, file, token);
        } 
        return rlt;
    } 
 
    public static String openUrl(Context context, String url, String method,
            WeiboParameters params, String file, Token token) throws WeiboException {
        String result = "";
        try { 
            HttpClient client = getNewHttpClient(context);
            HttpUriRequest request = null;
            ByteArrayOutputStream bos = null;
            if (method.equals("GET")) {
                url = url + "?" + encodeUrl(params);