Some serwer sends POST requests with the following information:
{
payload: {
uid: "900af657a65e",
amount: 50,
adjusted_amount: 25
},
signature: "4dd0f5da77ecaf88628967bbd91d9506"
}
How shoud I successfully process that in my ASHX handler?
As SLaks noted, that's not valid JSON. But in general, a good solution for serializing/deserializing JSON in .NET is the JSON.NET library: http://json.codeplex.com/. There is plenty of documentation there that should get you started.
Edit: to read the request body, try something like
string postData = new System.IO.StreamReader(context.Request.InputStream).ReadToEnd();
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