title: how to send a json string to a .NET REST service from java?
body: <p>i am trying to send a json string from my android client to my .net Rest service...
  can anyone help me in this issue?</p>
  
  <pre><code>HttpClient client = new DefaultHttpClient();
  HttpPost post = new HttpPost("http://myURL");
  
   JSONObject json = new JSONObject();
   json.put("name", "i am sample");
   StringEntity str = new StringEntity(json.toString());
   str.setContentType("application/json; charset=utf-8");
   str.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE,"application/json; charset=utf-8"));
   post.setEntity(str);
   HttpResponse response = client.execute(post);
  </code></pre>
  
  <p>Response is bad request. am i sending the json object as string? is this code correct?</p>