I have an API that returns an '.xls' file, using HttpResponseMessage
. What I am trying to do is to get that file and attach it to an email that I am sending.
Please keep in mind that I can't change the API implementation, so, the response will always be HtppResponseMessage
.
Well, apparently there is a solution for my problem. What I had to do was to get the
HttpContent
from the API'sHttpResponseMessage
asStream
. After that, all the process was a piece of cake.Here is the solution. It works great.
I hope that this helps someone else as well.
Cheers.