I am getting a post from an external vendor. I am not exactly sure what variables they are sending. How do I print out all the Request variables that they are sending in the post? there is no Request.Count or Request.Length so that I could loop and find everything.
Thanks in advance for your help.
The Request.Form
property contains a collection with all form fields. It is a NameValueCollection
which implements ICollection
so you should be able to loop it with foreach
. Request.Form.Keys
will give you all the form field names, then you can use that name to look up the value.
foreach(string key in Request.Form.Keys)
{
Response.Write(key + ": " + Request.Form[key] + "<br/>");
}
You can get it from Request.Forms
foreach(string key in Request.Form.Keys )
{
Response.Write ( key );
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With