1.先定义json对象;
2.定义对象的头;
JSONObject PlayJson=new JSONObject ();
JSONObject head=new JSONObject ();
head.put("title","我爱看书");
3.定义对象的内容;
JSONObject content=new JSONObject();
content.put("body","他也爱看书");
4.封装;
PlayJson.put("head",head);
PlayJson.put("content",content);
5.发送;
send(PlayJson.toString());
ps:这里的send()方法是自定义的方法。