I\'m trying to post JSON via AJAX to a Classic ASP page, which retrieves the value, checks a database and returns JSON to the original page.
I can post JSON via AJAX. I
alphadogg's solution didn't work for me, I got errors with the line bStream.Write requestBody
(saying "Operation is not allowed in this context.") This seems to work for me, and returns the whole request string. However, it will only work for request data <= 100 KB, otherwise you'll have to work out how to get the BinaryRead method working.
str = Request.Form
(Discovered from http://msdn.microsoft.com/en-us/library/ms525985%28v=VS.90%29.aspx)
You can find all posted parameters via this code.
FUNCTION getQueryString()
dim queryLink, queryItemName
queryLink = ""
On error Resume Next
For each queryItemName in Request.QueryString
Execute(queryItemName & " = stripQuery(Request.QueryString(""" & queryItemName & """))")
queryLink = queryLink & "&" & queryItemName & "=" & Request.QueryString(queryItemName)
Next
For each queryItemName in Request.Form
Execute(queryItemName & " = stripQuery(Request.Form(""" & queryItemName & """))")
queryLink = queryLink & "&" & queryItemName & "=" & Request.Form(queryItemName)
Next
On Error Goto 0
getQueryString = queryLink
END FUNCTION
response.write getQueryString()