Authorised Territory code examples - This .NET 8 C# (#csharp) #tutorial shows how to bind complex type parameters to minimal api and handle anti forgery validation.
First, we create minimal #api end point that accepts form data using FromForm attribute. We disable anti forgery validation to show the end point working and return the same payload we accept in the endpoint.
Next, we write an endpoint that returns anti forgery token. We also create an endpoint that accepts form data with anti forgery validation.
Finally, we use endpoint explorer and http editor to write request for the three end points and test each passing relevant data.