How to get HttpRequestMessage data
asp.net-mvc, c#
Solution
From this answer:
[HttpPost]
public void Confirmation(HttpRequestMessage request)
{
var content = request.Content;
string jsonContent = content.ReadAsStringAsync().Result;
}
Note: As seen in the comments, this code could cause a deadlock and should not be used. See this blog post for more detail.
Problem
I have an MVC API controller with the following action. I don't understand how to read the actual data/body of the Message? ``` [HttpPost] public void Confirmation(HttpRequestMessage request) { var content = request.Content; } ```