Get/post to RESTful web service

You’ll need to add a reference to the MSXML library:

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

Leave a Comment