Hi, I am writing a website in ASP .Net Core 3. I want to implement a method which will take 2 parameters in the POST query. The data sent to the server should be plain text, not JSON, e.g. request POST example.com/api the content of the task message_1="content"&message_2="content_2" <pre>The following function calls but the parameters are null. How is it going to change it?
[HttpPost] [Route("/api")] public IActionResult Api(string message_1, string message_2) { return View(); }
using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8)) { return = await reader.ReadToEndAsync(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)