CheckHttpCodeOnly.cs and CheckHttpCodesOnly.cs

Both scripts check for particular HTTP code(s) returned and only those are considered successful. Otherwise, an error alert is generated.

Custom Script File Arguments Arguments Example

CheckHttpCodeOnly.cs 

“<URL>” <code> <InvertCheck>

“https://www.nytimes.com” 302 

CheckHttpCodesOnly.cs

“<URL>” <list of codes>

“https://www.nytimes.com” 302 400 500 304

CheckHttpCodeOnly.cs available parameters:

  • <URL> – address to monitor.
  • <code> – numeric HTTP code.
  • additional parameter <InvertCheck> – boolean value, false by default, case sensitive. Use to invert a result of HTTP code monitoring.    

 <InvertCheck> examples:

  1. CheckHttpsCodeOnly.cs “https://www.google.com/” 302 equal to CheckHttpsCodeOnly.cs “https://www.google.com/” 302  false – if 302 code is returned the task is considered as successful. Otherwise, an error is generated. 
  2. CheckHttpsCodeOnly.cs “httpfghzghs://www.google.com/” 500 true – if any code other than 500 is returned the task is considered as successful. Otherwise, an error is generated. 

CheckHttpCodeOnly.cs available parameters:

  • <URL> – address to monitor.
  • <list of codes> – list of numeric HTTP codes separated by gaps.