I have created a httphandler. Everything is working fine If you take the request type GET. But I really don't want GET request due to security reasons.
I am making a POST request using Jquery using following code
context.Response.ContentType = "application/json; charset=utf-8"
Dim s As String = context.Request.Params("a")
context.Response.Write(JsonConvert.SerializeObject(s))
This code is returning 'null' in javascript alert in client side.
Please note every thing is working fine when request type is changed to GET in $.ajax() function.
I have also tried to access posted data using context.Request.Form("a") and context.request.SserverVariables("a")
context.request.Params is a combined collection of 'Form', 'ServerVariables', 'Cookies' etc.
Member
2 Points
34 Posts
Accessing Data in Httphandler sent using post request
Sep 29, 2011 11:22 AM|shashwat.tripathi|LINK
Hello friends
I have created a httphandler. Everything is working fine If you take the request type GET. But I really don't want GET request due to security reasons.
I am making a POST request using Jquery using following code
And the code for processing request is:
This code is returning 'null' in javascript alert in client side.
Please note every thing is working fine when request type is changed to GET in $.ajax() function.
I have also tried to access posted data using context.Request.Form("a") and context.request.SserverVariables("a")
context.request.Params is a combined collection of 'Form', 'ServerVariables', 'Cookies' etc.
Please tell me where I am going wrong...??
Thanks for looking....
Member
2 Points
34 Posts
Re: Accessing Data in Httphandler sent using post request
Oct 02, 2011 02:37 AM|shashwat.tripathi|LINK
It is working if I do remove contentType and dataType specification from request. And everything other than this will remain same.
It is very bad that no one could answer this my stupid question.