I have the need to:
1) send a json request to a service webapi2
2) the service must reply by sending me an xls file (without having to save the file on the server)
how can I achieve my goal?
I tried to use to write the following but does not work. What's wrong ?:
Result = New HttpResponseMessage(Net.HttpStatusCode.OK)
Dim test As StreamContent = New StreamContent(FileResult)
Result.Content = New StreamContent(FileResult)
Result.Content.Headers.Add("Content-Type", "application/xls")
Result.Content.Headers.Add("Content-Disposition", "attachment; filename=" + "sample.xls")
Result.Content.Headers.ContentType = New Headers.MediaTypeHeaderValue("application/octet-stream")
Thanks in advance
Luca