Answer the question
In order to leave comments, you need to log in
How to accept JSON to ASP.NET API controller?
A POST request comes to the controller. I'm trying to accept as a string - it doesn't work, it gives an error.
It seemed to work before, but now it doesn't work. I know that you can accept a model, but I would like a string. Help pliz I beg on my knees
CONSOLE.WRITELINE HERE NOT TO DO. THIS I WROTE LATER
Answer the question
In order to leave comments, you need to log in
[HttpPost(Name = "VkCallBackReceiver")]
public ActionResult Post([FromBody]string json) {
Console.WriteLine(json);
return Ok();
}
I know that you can accept a model, but I would like a string.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question