Attribute VB_Name = "HttpHandler" Option Explicit Function makeHttpRequest(method As String, route As String, doc As String, ByRef errorMsg As String) As Object Dim req As New WinHttp.WinHttpRequest Dim json As Object Dim wr As String Dim res() As Variant On Error GoTo errHandler Set makeHttpRequest = Nothing If doc = "" Then errorMsg = "No message to send to the server." Exit Function End If Dim server As String server = shConfig.Range("server").Value With req .Option(WinHttpRequestOption_SslErrorIgnoreFlags) = SslErrorFlag_Ignore_All .Open method, server & "/" & route, True .SetRequestHeader "Content-Type", "application/json" .Send doc Debug.Print method & " /" & route & " ("; Dim t As Single t = Timer .WaitForResponse wr = .ResponseText Debug.Print Timer - t; "sec): "; Left(wr, 200) End With If Mid(wr, 1, 1) <> "{" Or _ Mid(wr, 2, 5) = "error" Or _ Mid(wr, 1, 6) = "" Or _ Mid(wr, 1, 6) = "