Closed thomaseyde closed 3 weeks ago
Thanks for reporting will check and update.
@fabiocav pls comment and validate.
Hi @thomaseyde I checked and found its returning proper status code can you check that again.
public class PostCreated
{
[Function("PostCreated")]
public IActionResult Run(
[HttpTrigger(AuthorizationLevel.Function, "post")]
HttpRequestData req,
FunctionContext executionContext)
{
return new CreatedResult("", null); // Return a new CreatedResult with status code 201
}
}
@bhagyshricompany your code example is not the same as mine. You call a different constructor which, most likely, does different work.
yes as i tries with your code on that staus code is 201but that is api properties not coming cause of azure function.
PostCreated
IActionResult
new CreatedResult()
POST http://localhost:7071/api/PostCreated
204
, not201
Decompiled code shows that the default constructor passes
null
to its base and does not initialize theStatusCode
property. I suspect this causes the default return value to be returned.Decompiled code:
NuGet packages:
Http trigger: