function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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);