开发者

Get all post data from request

开发者 https://www.devze.com 2022-12-08 04:55 出处:网络
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

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 w开发者_JAVA百科ithout knowing they keys.


foreach(string name in Request.Form)
{
    Response.Write(Request.Form[name]);
}


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


You can use return Request.Form.ToString(); to get raw POST data.

0

精彩评论

暂无评论...
验证码 换一张
取 消