How can I get Post parameters and their values sent by the client within an action in MVC? I don't want to add a parameter to the action method matching the JSON structure sent by the client. I want to use the Request or any other property that exposes this information.
For instance, if the action is:
public ActionResult Index()
I don't want to write something like this to achieve the result:
public ActionResult Index(MyObject object)
Where MyObject is the class that matches the JSON sent by the client I want to navigate the Request or the raw text sent in the Request to get this info
Important: I'm executing via AJAX a HttpPost Request, I'm not submiting a form.
Using Request.InputStream works for submit Posts, but not for Ajax. The code for this is:
var input = new StreamReader(Request.InputStream).ReadToEnd();
In the case of Ajax the InputStream is empty