网页编程 - ASP获得JSON数据
bytecount = Request.TotalBytes
bytes = Request.BinaryRead(bytecount)
Set stream = Server.CreateObject("ADODB.Stream")
stream.Type = 1 'adTypeBinary
stream.Open()
stream.Write(bytes)
stream.Position = 0
stream.Type = 2 'adTypeText
stream.Charset = "utf-8"
s = stream.ReadText() 'here is your json as a string
stream.Close()
Set stream = nothing
Response.write(s)
得到的s就是json格式的字符串,就象{"userid":"apple","password":"test123456"}
然后再利用其它工具可以将json字符串中的相关信息提取出来。