C#C
C#2y ago
24 replies
Mario K.

.NET 6 web api - HttpClient.PostAsync not hitting HttpPost in controller

Hello !

I have a controller with [HttpPost] method, but httpclient.postasinc does not hit it. Instead it returns 400 (bad request)....
DeleteAsync and GetAsync properly hit corresponding [HttpDelete] and [HttpGet] methods in the controller ...

Any suggestions ?
Was this page helpful?