title: HTTP 415 Unsupported Media Type
body: <p>I have created a sample web service to make a post call.</p>
  
  <p>I am using Jersey JAX-RS, and Maven.</p>
  
  <p>web.xml</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;provider-serlvet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
              &lt;param-value&gt;org.is.ws.provider.rest.ProviderAggregateApplication&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;com.sun.jersey.api.json.POJOMappingFeature&lt;/param-name&gt;
              &lt;param-value&gt;true&lt;/param-value&gt;
           &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;provider-serlvet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>POM.XML</p>
  
  <pre><code>&lt;!-- Jersey jars --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-client&lt;/artifactId&gt;
          &lt;version&gt;1.19&lt;/version&gt;
      &lt;/dependency&gt; 
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-core&lt;/artifactId&gt;
          &lt;version&gt;1.19&lt;/version&gt;
      &lt;/dependency&gt;           
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
          &lt;version&gt;1.19&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-servlet&lt;/artifactId&gt;
          &lt;version&gt;1.19&lt;/version&gt;
      &lt;/dependency&gt;
        &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-json&lt;/artifactId&gt;
          &lt;version&gt;1.18&lt;/version&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
              &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
              &lt;version&gt;1.9.13&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>Method call:</p>
  
  <pre><code>@POST
  @Path(RESOURCE_PATH)
  @Produces("text/plain")
  public String getPCP(){
      return "Hello";
  }
  </code></pre>
  
  <p>Raw request: </p>
  
  <pre><code> POST http://localhost:9080/sep/pas/getPCP HTTP/1.1
   Connection: close
   Accept-Encoding: gzip,deflate
   Content-Type: application/json
   Content-Length: 69
   Host: localhost:9080
   User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
  
    {
      "patientID": "1234567890",
      "patientIDType": "XYZ"
    }
  </code></pre>
  
  <p>I have referred to following article</p>
  
  <p><a href="https://stackoverflow.com/questions/24932080/rest-webservice-returning-415-unsupported-media-type">REST Webservice returning 415 - Unsupported Media Type</a></p>
  
  <p>But still i'm having issue. </p>