我有这段代码从HTTPS网址获取并解析JSON:
Function GetJson(sUrl As String) As dynamic
if sUrl = invalid return invalid
httpGet = CreateObject("roUrlTransfer")
httpGet.SetURL(sUrl)
httpGet.EnableEncodings(true)
httpGet.RetainBodyOnError(true)
sData = httpGet.GetToString()
if sData = ""
print "ERROR: " + sUrl + " : " + httpGet.GetFailureReason()
end if
data = ParseJson(sData)
return data
End Function
sData为空。如何获取HTTP响应代码或错误? httpGet.GetFailureReason()
始终是空白的......
原来修复是添加这个,但我需要找出如何转储HTTP(s)错误,以便我知道发生了什么
httpGet.SetCertificatesFile("common:/certs/ca-bundle.crt")
httpGet.InitClientCertificates()
有什么想法吗?