1
으로 설정했기 때문에 전달 된 contentType이 무시됩니다. android httpclient (loopj)를 사용하여 일부 데이터를 게시하려고합니다. 본문에 일부 json 데이터를 추가하고 요청 헤더를 설정합니다. 그러나 AsyncHttpClient : Passed contentType HttpEntity가 내용 유형을 설정하기 때문에 무시됩니다. 어느 누구도이 문제를 해결하는 방법을 알고 있습니까?AsyncHttpClient : HttpEntity가 콘텐츠 유형을
public static void post(Activity context,String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
try {
JSONObject jsonParams = new JSONObject();
JSONObject innerObject = new JSONObject();
innerObject.put("Name", "@MODE");
innerObject.put("ParamType", "8");
innerObject.put("Value", "0");
JSONArray ar = new JSONArray();
ar.put(innerObject);
try {
jsonParams.put("ProcName", "Core.MENUS_SPR");
jsonParams.put("dbparams", ar);
Log.i("jsonParams.toString()",""+jsonParams.toString());
StringEntity se = null;
try {
se = new StringEntity(jsonParams.toString());
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return;
}
client.post(context, (url), se, "application/json", responseHandler);
} catch (JSONException e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
}
없음 운 아직도 AsyncHttpClient를 얻을 : 통과 contentType이 무시됩니다 HttpEntity 콘텐츠 유형 – playmaker420
같은 문제가 다시 며칠을 요청했다 설정하기 때문에 http://stackoverflow.com/a/26425401/2274724 –
나중에 시도해 보았습니다. 행운은 아직 없습니다 – playmaker420