Access post data directly

I have an action in one of my controllers that is going to receive HTTP POST requests from outside of my MVC website.

All these POST requests will have the same parameters and I need to be able to parse the parameters.

How can I access the post data from within the action?

This is potentially a very simple question!

Thanks


Solution 1:

The POST data from your HTTP Reques can be obtained at Request.Form.

Solution 2:

string data = new System.IO.StreamReader(Request.InputStream).ReadToEnd(); 

Solution 3:

Use

Request.InputStream 

This will give you raw access to the body of the HTTP message, which will contain all the POST variables.

http://msdn.microsoft.com/en-us/library/system.web.httprequest.inputstream.aspx