asp.net web api返回图片至前端
var response = Request.CreateResponse(HttpStatusCode.OK); response.Content = new ByteArrayContent(data); //data为二进制图片数据 response.Content.Headers.ContentType = new MediaTypeHeaderValue("image/png"); return response;
var response = Request.CreateResponse(HttpStatusCode.OK); response.Content = new ByteArrayContent(data); //data为二进制图片数据 response.Content.Headers.ContentType = new MediaTypeHeaderValue("image/png"); return response;