My client\'s API specifies that to remove an object, a DELETE request must be sent, containing Json header data describing the content. Effectively it\'s the same call as ad
The problematic line is con.setDoOutput(true);. Removing that will fix the error.
con.setDoOutput(true);
You can add request headers to a DELETE, using addRequestProperty or setRequestProperty, but you cannot add a request body.
addRequestProperty
setRequestProperty