Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions check_http_win.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,21 @@ End If
' Run the magic
Set http = CreateObject("MSXML2.ServerXMLHTTP")
http.open MyMethod,MyUrl,false

' Handle http.send possible connection issues
On Error Resume Next
If (MyMethod = "POST") Then
http.send MyData
Else
http.send
End If

If Left(Err.Description,53) = "A connection with the server could not be established" Then
wScript.Echo "Error in http.send: " & Err.Description
exitCode = 2
WScript.Quit(exitCode)
End If

' Handle return status
' No expected status given, use default handling of http status codes
If MyExpectIgnore = 1 Then
Expand Down