title: JIRA REST API - 415 Unsupported Media Type error in ClientResponse
body: <p>I am trying to send a POST request via a WebResource instance using a Jersey Client. But no matter how i specify the request headers or types, it will give me a <code>415 Unsupported Media Type</code> error. Below is my code</p>
  
  <pre><code>String SERVICE_URL = "http://hostIpAddress:8080/JiraUpdate/rest/createin/jira/createticket?"; // hostIpaddress is our server ip
  ClientConfig config = new DefaultClientConfig();
  Client client = Client.create(config);
  System.out.println("SERVICE_URL=" + SERVICE_URL);
  WebResource webResource = client.resource(UriBuilder.fromUri(SERVICE_URL).build());
  String input = "{\"fields\":{\"project\":{\"key\":\"Invoicing\"},\"summary\":\"REST Test\",\"description\": \"Creating of an issue using project keys and issue type names using the REST API\",\"issuetype\":{\"name\":\"Bug\"}}}";
  ClientResponse response = webResource.header("Content-Type", "application/json;charset=UTF-8")
        .type(MediaType.TEXT_PLAIN_TYPE).post(ClientResponse.class, input);
  </code></pre>
  
  <p>I have tried to set the type to <code>MediaType.APPLICATION_FORM_URLENCODED_TYPE</code> as well as <code>MediaType.APPLICATION_JSON</code> but it doesnt change the response. I am running this code as a standalone executable JAR in a linux environment. Any help is appreciated.</p>