+ Start a Discussion
EmpoweredEmpowered 

System.CalloutException: HTTP method DELETE doesn't support output

I am trying to use the DELETE method with HttpRequst and Http.  How do you get around this exception?

 

Thanks!

 

System.CalloutException: /HTTP method DELETE doesn't support output

 

The code. url is an endpoint, method is set to DELETE, params are set to a list of parameters.  

 

/HttpRequest req = new /HttpRequest();

url = urlMap.get(id);

req.setEndpoint(url);

req.setHeader('Content-Type', 'application/x-www-form-urlencoded');

req.setMethod(method);

req.setBody(params);  

/Http http = new /Http();

/http.send(req);