提问
WebAPI如何限制请求Content-Type
回答
控制器或者action上增加[Consumes("application/json")]特性
[ApiController]
[Authorize]
[Produces("application/json")]
[Consumes("application/json")]
public class WaveFormController : ControllerBase
{
...
}
WebAPI如何限制请求Content-Type
控制器或者action上增加[Consumes("application/json")]特性
[ApiController]
[Authorize]
[Produces("application/json")]
[Consumes("application/json")]
public class WaveFormController : ControllerBase
{
...
}