Web API Blazor

Reinaldo Morales 1 Reputation point
2022-01-24T12:39:37.347+00:00

Estimados,

Estoy trabajando en una solución blazor WASM y al hacer un llamado a un controller por POST no funciona desde el cliente, no arroja error ni excepción, simplemente entrega un badrequest, pero no se ejecuta el metodo del controller, hice la prueba del POST desde Postman y se ejecuta sin problema, en el cliente tengo registrados los servicios.
Solo el POST no funciona, hice un GET y este funciona correctamente.
Si me pueden ayudar para saber cual es el problema se los agradecería.

Este es el código con el que llamo al Controller.

167896-image.png

Este es el controller

167839-image.png

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,584 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,588 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Reinaldo Morales 1 Reputation point
    2022-01-25T16:24:55.197+00:00

    Thanks for the information,
    My problem is because I'm working with blazor WASM and when I try to make a call to a POST method on a controller using HttpClient.PostAsJsonAsync this don't work but not return a exception or error, simply show a bad request, I can call controller from postman and work normally, the GET call function too.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.