title: JAVA Http POST request in UTF-8
body: <p>My J2EE application is able to receive POST request from a JSP page, no problem about that.</p>
  
  <p>But if I use another java application to send a POST request, the parameter received is not an UTF-8 string.</p>
  
  <p>Here there is my code:</p>
  
  <pre><code>URL url = new URL("http://localhost:8080/ITUNLPWebInterface/SimpleApi");
  HttpURLConnection cox = (HttpURLConnection) url.openConnection();
  
  cox.setDoInput(true);
  cox.setDoOutput(true);
  cox.setRequestMethod("POST");
  cox.setRequestProperty("Accept-Charset", "UTF-8");
  cox.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
  cox.setRequestProperty("charset", "UTF-8");
  
  DataOutputStream dos = new DataOutputStream(cox.getOutputStream());
  String query = "tool=ner&amp;input=şaşaşa";
  dos.writeBytes(query);
  dos.close();
  </code></pre>
  
  <p>Am I doing something wrong?</p>
  
  <p>Thanks for your reply</p>