HttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(URL); try { StringEntity documentStringified = new StringEntity(Obj.toString()); httpPost.setEntity(documentStringified); } catch (UnsupportedEncodingException e) { Log.d("UnsupportedEncodingException", e.toString()); } try { HttpResponse response = httpClient.execute(httpPost); Log.d("Response", response.toString()); } catch (IOException e) { Log.d("IOException", e.toString()); } I am not able to get the response. How to print the response in Logger or console. response.toString() or response.getEntity.toString() does not work.
Should i set the Content-type as "application/json".