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
IGCTOIGCTO 

The limit for setBody is 3 MB. Is this before or after compression?

For the HttpRequest Class, setBody has a limit of 3 MB:

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_http_httprequest.htm

 

set Compressed sends the data in the body in compressed format.

 

I would hope that the 3 MB applies to the compressed data, but this is not clear in the documentation.

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox
The limit is pre-compression. This is more related to heap size (memory usage) and CPU usage (processor time) rather than bandwidth usage. Your data will consume 3MB until it is sent; setBody does not apply compression, but rather Http.Send does.