Can anyone tell me if it is possible to get binary data back from a web service callout?
I am using the apex Http, HttpRequest and HttpResponse classes to call an external service that returns a binary file. I then attach that file to an email programatically. Everything works fine, except that my binary data in the attachment is mangled, because of the string conversion on response.getBody(). Is there a way to retrieve the binary stream from the HttpResponse class without corrupting it?
Or is there another set of classes I should use to perform this function to get the results I'm looking for?
Thanks for any help!