Search notes:

MSXML

MSXML (Microsoft XML Core Services) provides a comprehensive set of W3C compliant XML APIs for building high-performance XML-based applications and allows to build XML-based applications.

Adding a VBA reference

call application.VBE.activeVBProject.references.addFromGuid("{F5078F18-C551-11D3-89B9-0000F81FE221}", 6, 0)

GET request

The following Visual Basic for Applications example tries to make a HTTP GET request.
option explicit

sub main() ' {

   dim httpReq as new MSXML2.ServerXMLHTTP60

   httpReq.open "GET", "https://google.com", false
   httpReq.send

   if httpReq.Status <> 200 then
      debug.print ("I am so sorry")
      debug.print (httpReq.status & ": " & httpReq.statusText)
      debug.print (httpReq.responseText)
      exit sub
   end if

   debug.print (httpReq.responseText)

end sub ' }
Github repository about-VBA, path: /object-libraries/MSXML/ServerXMLHTTP/GET.bas
TODO: Apparently, MSXML2.ServerXMLHTTP60 can be exchanged with MSXML2.xmlHTTP in which case credentials (username and password) are automatically passed if authentification is needed.
Compare with the corressponding WinHTTP example.
See also: get.vbs

TODO: Members of IXMLHTTTPRequestMembers

abort() Cancels the current HTTP request.
getAllResponseHeaders() Retrieves the values of all the HTTP headers.
getResponseHeader() Retrieves the value of an HTTP header from the response body.
onreadystatechange The (read/write) event handler to be called when the readyState property changes. This is an extension to W3C DOM.
open() Initializes an MSXML2.XMLHTTP request, and specifies the HTTP request method, URL and authentication information for the request.
readyState Represents the state of the request. Read-only.
responseBody A byte array (byte()), one of several forms in which the HTTP response can be returned. Read-only.
responseStream Represents only one of several forms in which the HTTP response can be returned. Read-only.
responseText The response body as a string. Read-only.
responseXML Represents the parsed response entity body. Read-only.
send() Sends an HTTP request to the server and receives a response.
setRequestHeader() Specifies the name of an HTTP header. This method can only be called after open was called. See also here.
status Represents the status code returned by a request. Read-only.
statusText Represents the HTTP response line status. Read-only.

See also

MSXML and DOM
Useful object libraries

Index