Not return HTTP Status code 201 when POST
Opened this issue · 4 comments
workcontrolgit commented
The status code is returned as 200 after successful post. It should be 201.
workcontrolgit commented
The fix is included in v 1.3.3
workcontrolgit commented
[HttpPost]
[ProducesResponseType(StatusCodes.Status201Created)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
// [Authorize]
public async Task<IActionResult> Post(CreatePositionCommand command)
{
var resp = await Mediator.Send(command);
return CreatedAtAction(nameof(Post), resp);
}
davidhenley commented
@workcontrolgit that should be CreatedAtAction(nameof(Get), new { Id = resp }, resp);
workcontrolgit commented
@davidhenley thank you