Accept x-www-form-urlencoded in Web API .NET Core

Try using [FromForm] instead of [FromBody].

public IActionResult Post([FromForm] PlayerPackage playerPackage)
  • FromBody > Bind from JSON

  • FromForm > Bind from Form parameters

You can also remove [FromBody] altogether and trial it then. Because you are expecting form-urlencoded should tell it to bind to object.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)