title: Pass request parameter to delete request in rest
body: <p>I am using resteasy. Here is a code to delete a resource.</p>
  
  <pre><code>@DELETE
  @Produces(MediaType.APPLICATION_JSON)
  @Consumes(MediaType.APPLICATION_JSON)
  @Path("/{id:\\d+}")
  public Response removeResource(@PathParam("id") int id){
      .........................
      .. code to delete resource and return Response object ..
      .........................
  }
  </code></pre>
  
  <p>This code is working fine. But when I try to pass some parameter to delete request. I am getting <code>UnsupportedMediaException</code></p>
  
  <pre><code>@DELETE
  @Produces(MediaType.APPLICATION_JSON)
  @Consumes(MediaType.APPLICATION_JSON)
  @Path("/{id:\\d+}")
  public Response removeResource(@PathParam("id") int id, Map&lt;String, Object&gt; source){
      .........................
      .. code to delete resource and return Response object ..
      .........................
  }
  </code></pre>
  
  <p>I need to send some parameter for some reason. Moreover when I just replace <code>delete</code> request with <code>put</code> request i.e. replacing <code>@DELETE</code> with <code>@PUT</code>, the code works fine.</p>
  
  <p>Is there any way to pass parameter to delete request.</p>
  
  <p>And at front end I was using angularjs's $resource to send DELETE request</p>
  
  <pre><code>var r = $Resource(/rest/resources/1);    // for debugging purpose I made id 1
  r.remove({"key1":"data1", "key2", "data2"});
  </code></pre>
  
  <p><strong>Edit :</strong><br>
  Stack trace from server</p>
  
  <pre><code>11:43:25,767 ERROR [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-7) RESTEASY002010: Failed to execute: javax.ws.rs.NotSupportedException: RESTEASY003065: Cannot consume content type
  at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:382)
  at org.jboss.resteasy.core.registry.SegmentNode.match(SegmentNode.java:116)
  at org.jboss.resteasy.core.registry.RootNode.match(RootNode.java:43)
  at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:48)
  at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:445)
  at org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatcher.java:257)
  at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:194)
  at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
  at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
  at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
  </code></pre>
  
  <p>Response at front-end</p>
  
  <pre><code>Status Code: 415 Unsupported Media Type
  Connection: keep-alive
  Content-Length: 0
  Date: Wed, 01 Jun 2016 06:13:25 GMT
  Server: WildFly/10
  x-powered-by: Undertow/1
  </code></pre>