【发布时间】:2017-02-25 05:26:05
【问题描述】:
客户端将向我们的 Web api 服务发出 GET 请求,我们需要使用指定的文件响应该请求。
文件内容将是字节数组,如:
byte[] fileContent = Convert.FromBase64String(retrievedAnnotation.DocumentBody);
如何将上述文件内容作为文件响应 GET 请求?
我已经删除了一个控制器:
[Route("Note({noteGuid:guid})/attachment", Name = "GetAttachment")]
[HttpGet]
public async Task<object> GetAttachment(Guid noteGuid)
{
return new object();
}
如何将文件内容返回给 GET 请求,而不是新对象?
【问题讨论】:
标签: c# asp.net .net rest asp.net-web-api