0

This is my code snippest

else if("Delete".equalsIgnoreCase(fields.getServiceAction())){
            logger.info("Delete method is calling");

             response = resource.accept("application/json")
                        .type("application/json").delete(ClientResponse.class, input);

This is my Exception logs

Caused by: java.net.ProtocolException: HTTP method DELETE doesn't support output  at

sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1081) at com.sun.jersey.client.urlconnection.URLConnectionClientHandler$1$1.getOutputStream(URLConnectionClientHandler.java:238) at com.sun.jersey.api.client.CommittingOutputStream.commitStream(CommittingOutputStream.java:117) at com.sun.jersey.api.client.CommittingOutputStream.write(CommittingOutputStream.java:89) at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221) at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291) at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295) at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141) at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229) at java.io.BufferedWriter.flush(BufferedWriter.java:254) at com.sun.jersey.core.util.ReaderWriter.writeToAsString(ReaderWriter.java:191) at com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider.writeToAsString(AbstractMessageReaderWriterProvider.java:128)

Please let me know is there any way to send JSON data HTTP delete method?

Saurabh Gadariya
  • 191
  • 6
  • 20
  • Apparently this is... [complicated... as explained in this Q/A](http://stackoverflow.com/questions/299628/is-an-entity-body-allowed-for-an-http-delete-request) – Hugues M. May 07 '17 at 12:00
  • 2
    Possible duplicate of [Is an entity body allowed for an HTTP DELETE request?](http://stackoverflow.com/questions/299628/is-an-entity-body-allowed-for-an-http-delete-request) – Hugues M. May 07 '17 at 12:01

0 Answers0