Open jaceks2106 opened 1 week ago
I checked the issue, correct Created() return 204, this seems to be fixed in dotnet9. in this commit: https://github.com/dotnet/aspnetcore/commit/2bcfbd783a1e421840b2a638ff193ebb527c184e for dotnet8 I am not sure if an open PR exist. If not I can contribute one
Is there an existing issue for this?
Describe the bug
.NET 8. When controller endpoint has return type
IActionResult
and return object is made by parameterless Created() method, response status code is 204. The workaround is following:Expected Behavior
I do not mean, that when there is no content in the response, then NoContent should not be returned, but when I explicitly want to return 201, I would expect 201, otherwise it's a breaking change for the contract of our WebAPI.
Steps To Reproduce
Exceptions (if any)
No response
.NET Version
8.0.400
Anything else?
No response