• Empowered
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

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);