Ich brauche WebAPI-Methode, die Datei und einige zusätzliche Daten zurückgibt. Ich versuche, es zu tun:WebAPI - Rückgabedatei und zusätzliche Daten
HttpResponseMessage result = Request.CreateResponse<OCRResult>(HttpStatusCode.OK, ocrResult);
var stream = new FileStream(@"D:\\_forTest.jpg", FileMode.Open);
result.Content = new StreamContent(stream);
result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");
result.Content.Headers.ContentDisposition.FileName = Path.GetFileName("_forTest.jpg");
result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
result.Content.Headers.ContentLength = stream.Length;
return result;
aber ich sehe nur in zurückgegebene Ergebnis-Datei, keine zusätzlichen json Daten (natürlich ist Inhaltstyp nicht json). Wie man es "kombiniert"?