客户端与服务器json交互问题
服务器怎么得到客户端发送的json格式的数据 android 服务器 --------------------编程问答-------------------- 那就看你数据是如何post过去的呀。 --------------------编程问答-------------------- HttpClient client = new DefaultHttpClient();HttpPost post = new HttpPost(url);
JSONObject response = null;
try {
StringEntity s = new StringEntity(json.toString());
s.setContentEncoding("UTF-8");
s.setContentType("application/json");
post.setEntity(s);
HttpResponse res = client.execute(post);
if(res.getStatusLine().getStatusCode() == HttpStatus.OK.value()){
HttpEntity entity = res.getEntity();
String charset = EntityUtils.getContentCharSet(entity);}
response = new JSONObject(charset);
--------------------编程问答-------------------- 奇葩,这个问题让人不知从何处开始回答 --------------------编程问答-------------------- 额 是问题不够清晰么
补充:移动开发 , Android