Set xmlHttp = CreateObject("Msxml2.XMLHTTP") 'create object On Error Resume Next 'error handling xmlHttp.Open "POST", urlStr, False 'open connection using "POST" method, asynchronously 'sending FORM data xmlHttp.setRequestHeader "Content-Type", _ "application/x-www-form-urlencoded" xmlHttp.Send 'send HTTP request to the server
If Err.Number = 0 Then 'if no error occurred retStr = xmlHttp.responseText 'wait for receive response from server Else retStr = "Url not found" 'error message End If Set xmlHttp = nothing 'free the object GetResult = retStr 'return the response to the caller End Function