title: Do a HTTPPost request with JSON Body, Android
body: <p>I 'm pretty new to Android. So, I 'm struggling with a HttpPost in android with Json Data.</p>
  
  <pre><code>JSONObject jsonObj = new JSONObject();
  JSONObject jsonObjDasUser = new JSONObject();
  
      jsonObj.put("name", "Login");
      jsonObj.put("type", "request");
      jsonObj.put("UserCredential", jsonObjUserCredential );
      jsonObjUserCredential .put("username", id);
      jsonObjUserCredential .put("password", password);
  
  // Create the POST object and add the parameters
  HttpPost httpPost = new HttpPost(url); 
  
  StringEntity entity = new StringEntity(jsonObj.toString(), HTTP.UTF_8);
  
  entity.setContentType("application/json");
  httpPost.setEntity(entity);
  HttpClient client = new DefaultHttpClient();
  </code></pre>
  
  <p>How can I include the jsonObjUserCredential as a entity like:::</p>
  
  <pre><code>//StringEntity userCredential = new StringEntity(jsonObjUserCredential .toString(),HTTP.UTF_8);??????
  </code></pre>
  
  <p>What am doing wrong here?????</p>
  
  <p>Please Help me....</p>