Get Classic ASP variable from posted JSON

后端 未结 8 2008
挽巷
挽巷 2021-02-08 11:01

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

8条回答
  •  猫巷女王i
    2021-02-08 11:32

    Don't know if you are still looking, but this answer may help you. However, the code is for ASP.NET pages. The classic ASP analog is:

      byteCount = Request.TotalBytes
      requestBody = Request.BinaryRead(byteCount)
    

    Then, you probably want to turn it into a string to parse/use. You can use ADODB.Stream for the conversion.

      Set bStream= CreateObject("ADODB.Stream")
      bStream.Open
      bStream.Write requestBody
      bStream.Position = 0
      bStream.Type = adTypeText 
      str = bStream.ReadText
    

提交回复
热议问题