Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've done many integrations so far but none of them required sending an HTTP request with the 'DELETE' method. And today, surprise - HTTP method DELETE doesn't support output appears in my log when I try to make this call.

I couldn't find any related questions/answers on this error apart from this.

The code is simple:

Http h = new Http ();

httpRequest = new HttpRequest ();


The documentation says that the DELETE method is supported too, though there isn't any additional information on this.

Is there a different way of implementing this method or is there something obvious that I'm missing here?

share|improve this question
any good answer for this? I also have this problem when delete a record to other server. – rpm07 Feb 12 '15 at 6:06
@robertpeter07 As you can see from the answers, you are not allowed to set the body in a delete request. – Boris Bachovski Feb 12 '15 at 23:32
up vote 9 down vote accepted

I'd suggest you need to avoid the call to setBody() when making a DELETE call

I doubt DELETE permits an http body of any size.

share|improve this answer

Since I had the code in a static method, I was setting the body to whatever comes in the parameter.

If you ever get this problem, avoid setting the body:

if (String.isNotBlank(body))

Worked like a charm!

share|improve this answer
This doesn't seem clear to me. – rpm07 Feb 12 '15 at 6:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.