title: Using Apache Http Client for a POST request
body: <p>I'm trying to develop a Java application with Gson to use an external api to get a simple text translation. Below is code and output. I've used my API key at the designated location for API key in the HTTP post URL
  Could you please help me get this working?
  Thank you very much.</p>
  
  <p>// CODE</p>
  
  <pre><code>HttpClient client = new DefaultHttpClient();
  HttpPost post = new HttpPost("URL");
  
  StringEntity input = new StringEntity(json);
  input.setContentType("application/json");
  post.setEntity(input);
  HttpResponse response = client.execute(post);
  System.out.println(response.getStatusLine());  
  </code></pre>
  
  <p>//OUTPUT</p>
  
  <pre><code>HTTP/1.1 415 Unsupported Media Type
  </code></pre>