Package

Source Code of TestJson

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import com.qq.open.common.json.JSONArray;
import com.qq.open.common.json.JSONObject;


public class TestJson {

  /**
   * @param args
   * @throws Exception
   */
  public static void main(String[] args) throws Exception {
   
   
   
    String str = "callback( {\"client_id\":\"YOUR_APPID\",\"openid\":\"YOUR_OPENID\"})";
   
    String temp = str.substring(str.indexOf("{"),str.indexOf("}") + 1);
    // 接口返回的数据json
    JSONObject jsonObjRoot = new JSONObject(temp);
   
    System.out.println(jsonObjRoot.get("openid"));
   
  }

}
TOP

Related Classes of TestJson

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.