Bind JSON POST to MVC Action

You already put a [method: HttpPost] attribute on the action.

But when you look at the received parameter, it is null.

Hint: try the [FromBody] attribute on the parameters.

And ensure the POST is given a Content-type of application/json

x.setRequestHeader('Content-type', 'application/json')

Sources

results matching ""

    No results matching ""