I need to listen and process a HTTP POST string in a HTTP handler.
Below is the code for posting the string to handler -
string test = "charset = UTF-8 & param1 = val1 & param2 = val2 & param3 = val3 & param4 = val4;
byte[] data = Encoding.UTF8.GetBytes(test);
PostData("http://localhost:53117/Handler.ashx", data);
What I tried in Handler is -
public void ProcessRequest(HttpContext context)
{
var value1 = context.Request["param1"];
}
But its null. How can I listen and get the parameter values in Handler?
Change
var value1 = context.Request["param1"];
to
var value1 = context.Request.Form["param1"];
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