title: POST to Jersey REST service getting error 415 Unsupported Media Type
body: <p>I am using a JAX-RS web application with Jersey and Tomcat. Get requests are fine however when I try to post JSON I get an HTTP status 415 - Unsupported Media Type.</p>
  
  <p>Here is my simple HelloWorld.java:</p>
  
  <pre><code>package service;
  
  import javax.ws.rs.*;
  
  @Path("hello")
  public class HelloWorld {
      @GET
      @Produces("text/plain")
      public String get() {
          return "hello world";
      }
  
      @POST
      @Consumes("application/json")
      public String post(JS input) {
          return input.hello;
      }
  
      public static class JS {
          public String hello;
      }
  }
  </code></pre>
  
  <p>Here is the request I try in Postman (with 'application/json' header):</p>
  
  <p><img src="https://i.stack.imgur.com/98V8M.jpg" alt="enter image description here">
  Here is the project layout with libraries:
  <img src="https://i.stack.imgur.com/8FtyM.jpg" alt="enter image description here"></p>
  
  <p>I am using:</p>
  
  <ul>
  <li>Java 7 x64</li>
  <li>Jersey 2.17</li>
  <li>Tomcat 7.0.62 x64</li>
  </ul>
  
  <p>Thanks!</p>