Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get all post data from request

Tags:

asp.net

Is there any way to get all the POST data sent to a .NET webpage?

Basically I am looking for the equivalent of the PHP $_POST array

The purpose being that I am receiving requests from a client that I have no control over and need to get all the data without knowing they keys.

like image 307
therealsix Avatar asked Oct 08 '09 14:10

therealsix


2 Answers

foreach(string name in Request.Form)
{
    Response.Write(Request.Form[name]);
}
like image 112
Rubens Farias Avatar answered Sep 23 '22 00:09

Rubens Farias


You want Request.Form There's a keys collection in there you can iterate through.

like image 40
Joel Coehoorn Avatar answered Sep 23 '22 00:09

Joel Coehoorn