Skip to content
Yoann Gini edited this page Nov 2, 2017 · 11 revisions

Function description

Goal

This function is used to check the content of a HTTP(S) web page. The aim of this function is to know if you can contact a server or not.

As an example, you can add two instance of this function, one for checking access to Internet server and an other for Intranet servers.

Settings

The settings dictionary contain all informations you can set to use this function. Here is a description of each.

Key Type Description
title Translatable string (see: Label translation) Item's title shown in the menu
URL String URL to test
mode String Comparaison algorithm you want to use (see below for acceptable values)

Supported mode

Mode Description
md5 Make a md5 sum and compare it to originalString
compare Content must be exactly the same as originalString
contain Valid if originalString is found in the answer's body

The md5 hash can be created with curl http://www.example.com | md5

Sample settings

<key>title</key>
<dict>
	<key>en</key>
	<string>Self-Service</string>
	<key>fr</key>
	<string>Libre-service</string>
</dict>

More informations

Main implementation

The main implementation of this function is made in the TestHTTP plugin from the main project.