我需要从VB6做一些GET和POST到RESTful Web服务。最好的和最简单的方法是做什么?
解决方法
您需要添加对MSXML库的引用:
Dim sUrl As String Dim response As String Dim xmlhttp Set sUrl = "http://my.domain.com/service/operation/param" Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP") xmlhttp.open "POST",sURL,False xmlhttp.setRequestHeader "Content-Type","application/x-www-form-urlencoded" xmlhttp.send() Dim response As String = xmlhttp.responseText Set xmlhttp = Nothing