【发布时间】:2019-03-26 13:15:13
【问题描述】:
我正在开发 WebAPI .Net Core 2.2,我已经成功添加了 swagger 并且从 swagger UI 我能够创建 POST 或 GET 请求。但是当我从 Postman 执行端点时,什么也没发生。甚至断点命中端点,但邮递员 UI 上未显示正确的结果
[HttpPost]
[Route("Details/{year:int}/Directors")]
public ActionResult DirectoryMoviesByYear(int year)
{
//sample code
return Ok(new Director { Id=1, Name="Peter Jackson" });
}
Postman 中使用的端点 https://localhost:44386/api/Movie/Details/1980/Directors
这里是大摇大摆的屏幕截图 result from swagger 这是邮递员的屏幕截图 enter image description here
【问题讨论】:
-
proper result is not shown on postman UI,是什么意思?您在 Postman 中得到什么?什么状态码,响应正文? -
@zeeshan 你能发一张你邮递员的截图吗?
-
添加了来自招摇和邮递员的屏幕截图。希望大家理解这个问题
标签: asp.net-core .net-core asp.net-core-webapi