VBS 调用web接口

Dim objHTTP,xmlDOC,strWebserviceURL,strRequest,bOK,xmlStr
Set objHTTP = CreateObject("MSXML2.XMLHTTP")
'Set xmlDOC =CreateObject("MSXML.DOMDocument")'解析XML
strWebserviceURL = "http://192.168.1.101:80/test/UpLoad"
'设置参数及其值
strRequest = "UpLoadDB=111"
objHTTP.Open "POST", strWebserviceURL, False
'设置这个Content-Type很重要
objHTTP.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHTTP.Send(strRequest)
'看看状态值
MsgBox objHTTP.Status
Msgbox objHTTP.StatusText
MsgBox objHTTP.responseText

你可能感兴趣的:(VBS)