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.
// 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());
//OUTPUT
HTTP/1.1 415 Unsupported Media Type