title: Can't get the payload of a POST Request in Jersey
body: <p>I need to recover the whole payload of a form POST request, to send it back to the receiver (PayPal requires this as a verification procedure). I tried several ways but I always get the same warning, with no payload:</p>
  
  <pre><code>Warning:   A servlet request to the URI http://localhost:8080/ipnlistener contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
  </code></pre>
  
  <p>Here's the code of the listener</p>
  
  <pre><code>@POST
  @Path("/ipnlistener")
  public Response testIpn(String t) {  
     System.out.println(t);
     return Response.ok().build();
  }
  </code></pre>
  
  <p>I tried to add different <code>Consumes</code> annotations but nothing changes. Of course with <code>FormParam</code> annotations I'm able to retrieve single fields, but I really need the whole body of the request.</p>
  
  <p>I also tried with the following</p>
  
  <pre><code>public Response testIpn(@Context HttpServletRequest req) throws IOException {  
      BufferedReader reader= req.getReader();
      String sCurrentLine;
      while ((sCurrentLine = reader.readLine()) != null) {
          System.out.println(sCurrentLine);
      }
  
     return Response.ok().build();
  }
  </code></pre>
  
  <p>but I get the error</p>
  
  <pre><code>getInputStream() has already been called for this request
  </code></pre>