【发布时间】:2020-12-01 02:14:11
【问题描述】:
在 .NET Core 3.x 中接收 IEnumerable 作为 GET 端点的 URI 参数的最佳方式是什么
在更深层次的背景下:我想做的是根据 GUID 的数量过滤掉数据。
目前为止
[HttpGet]
public ActionResult Get(int allowedMissing, IEnumerable<Guid> ids)
.
.
.
我使用 Postman 调用端点,如下所示:
/endpoint?allowedMissing=2&ids=cab0cfcb-8eb2-4313-8064-e7b0841d4f8a&ids=b2b944c2-6b4a-4c32-9a2f-472b891e4843
这会导致415 Unsupported Media Type,而不会在控制器内遇到任何断点。
【问题讨论】:
标签: api asp.net-core .net-core get postman