远程访问无法返回数据

jielei 2016-06-02 09:14:29
我在浏览器中直接输入这段网址
https://gw.open.1688.com/openapi/http/1/system.oauth2/getToken/YOUR_APPKEY?grant_type=authorization_code&need_refresh_token=true&client_id= YOUR_APPKEY&client_secret= YOUR_APPSECRET&redirect_uri=YOUR_REDIRECT_URI&code=CODE

会返回这个结果:
{"aliId":"8888888888","resource_owner":"xxx","memberId":"xxxxxxx","expires_in":"36000","refresh_token":"479f9564-1049-456e-ab62-29d3e82277d9","access_token":"f14da3b8-b0b1-4f73-a5de-9bed637e0188","refresh_token_timeout":"20121222222222+0800"}


为什么我使用xmlhttp却返回不了上面的结果呢?


Function GetBody(url,data) '飘易-获取远程IP地址POST信息
Set https = Server.CreateObject("MSXML2.XMLHTTP")
With https
.Open "Post", url, False
.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
.Send data
GetBody = https.ResponseBody
End With
GetBody = BytesToBstr(GetBody,"GB2312")
Set https = Nothing
End Function


Function BytesToBstr(body,Cset) '飘易:转换GB2312
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function


responseXMltop= GetBody("https://gw.open.1688.com/openapi/http/1/system.oauth2/getToken/"&appKey, "code="&code&"&client_id="&appKey&"&redirect_uri="&redirect_uri&"&client_secret="&secretCode&"&grant_type=authorization_code&need_refresh_token=true")
response.Write(responseXMltop)


得出的结果是空
...全文
316 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2016-06-03
  • 打赏
  • 举报
回复
浏览器中直接输入 不是 GET方式吗? 而 GetBody里是 Post,确定 Post可用? 另外 ASP里可用 ServerXMLHTTP
Dogfish 2016-06-03
  • 打赏
  • 举报
回复
还有,楼主看看是否ssl支持问题。有时候有这种问题的。

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧