AsyncHttpClient
POST JSON数据,如果我在JSON中有中文,那么响应是
http 400 The request sent by the client was syntactically incorrect ()
我的服务器是Rest服务器。谁能告诉我这个错误是如何发生的,因为我的服务器可以正确接收中文?
StringEntity entity =null;
try {
entity = new StringEntity(jsonEntity==null ?null : jsonEntity.toString());
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
client.post(context, getAbsoluteUrl(url), entity, "application/json", responseHandler);