https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html
几年前是好好的,怎么现在接口改了,就没有返回数据了?连错误信息都不返回,还卡顿,而通过code换取网页授权access_token的链接在浏览器地址栏输入是可以正确返回内容的,用VBS也是能正确返回数据的,怎么 ASP+("msxml2.xmlhttp.6.0") 就不行了呢?
获取code后,请求以下链接获取access_token:
https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code
Function GetBody(url)
on error resume next
dim strx,Retrieval
Set Retrieval =server.CreateObject("msxml2.xmlhttp.6.0") '("Microsoft.XMLHTTP") '
With Retrieval
Retrieval.Open "Get", url, False, "", ""
Retrieval.Send
'strx = Retrieval.ResponseBody
strx = Retrieval.ResponseText
End With
'response.write "ok1"
If Len(strx) > 1 Then
GetBody = strx 'BytesToStr(strx, "UTF-8")
End If
Set Retrieval = Nothing
End Function
你好,请问请求成功了吗?报错提示什么呢?