You need to sign in to do that
Don't have an account?
Benabus
http post file
Hi all,
So my ultimate goal is to take a document that has been uploaded to salesforce and programatically send that file via a post request to an external server to do some parsing on it.
Sending regular posts is relatively simple. Is it possible to do this with a file? I'm relatively new to apex.
Thanks.
You would have to package the callout payload in such a way that the receiving web service would accept it. There are apex Blob methods that will take an Attachment record data and convert it in various ways.
Instead, use EncodingUtil to convert the file from a blob to base64, then set the HTTP header 'Transfer-Encoding' to 'base64'. Your server needs to support this parameter for this to work, however.