【发布时间】:2017-11-30 19:17:37
【问题描述】:
对于返回模型的端点,我们可以使用ResponseTypeAttribute 告诉帮助页面文档返回数据的样子:
/// <summary>
/// returns the specified Foo.
/// </summary>
[ResponseType(typeof(FooModel))]
[HttpGet]
[Route("~/api/foos/{fooId}")]
public async Task<IHttpActionResult> GetFoo(int fooId)
{
...
}
这将在 Api 帮助页面上创建一个很好的条目,描述此端点的行为方式。
我想记录某个端点将返回一个应用程序/zip 二进制流。我该怎么做?
【问题讨论】:
标签: c# asp.net-web-api documentation asp.net-mvc-apiexplorer