<%
Function RB_Post(url,data,imgpath)
Set XmlObj = Server.CreateObject(“Msxml2.XMLHTTP.6.0”)
XmlObj.open “POST”, url, False
XmlObj.SetRequestHeader “Accept”,"/"
XmlObj.SetRequestHeader “Accept-Language”,“zh-cn”
XmlObj.setRequestHeader "Content-Type ",“application/x-www-form-urlencoded”
XmlObj.SetRequestHeader “User-Agent”, Request.ServerVariables(“HTTP_USER_AGENT”)
XmlObj.SetRequestHeader “Content-Length”,Len(data)
XmlObj.setRequestHeader “Connection”,“Close”
XmlObj.setRequestHeader “Cache-Control”,“no-cache”
XmlObj.send(data)
Set st=server.CreateObject(“adodb.stream”)
st.type=1
st.mode=3
st.open
st.position=0
st.write XmlObj.ResponseBody
st.savetofile server.MapPath(imgpath),2
st.close
Set st=Nothing
RB_Post=imgpath
Set XmlObj = nothing
End Function
Dim url,data,ACCESS_TOKEN,testimg
ACCESS_TOKEN=“12_545454545454fdsafdsafsdafsdafds”
url = “https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=”&ACCESS_TOKEN
data="{"“path”":"“pages/index?query=1"”,"“width”":430}"
testimg = RB_Post(url,data,“333.png”)
response.Write testimg
%>