Visual Studio 2017 with Web Api using .net Core 1.1 I'm using, but I am getting a 400 Bad Request Error.
Error Occurs in every way:
ASP.NET Web API “400 Bad Request” on POST Request
[HttpPut]
//[ValidateAntiForgeryToken]
public IActionResult Put([FromBody]VeteranInteraction sessionTracker)
{ //.... }
Why is this happening ?
ValidateAntiForgeryToken
is the problem , if I comment it out it works.
You need to send the AntiForgery token on every request where it's being validated either as a cookie or as a http header.
Refer to the documentation here. They have a section on how to configure angular js to do it.