IsValidPlainHTTPURL (open)

Test whether an URL is a valid HTTP url

Syntax

LOADLIB "wh::internet/urls.whlib";

BOOLEAN FUNCTION IsValidPlainHTTPURL(STRING url)

Parameters

STRING url

URL to check

Return value

BOOLEAN

True if the URL appears to be a valid HTTP URL.

Description

This function verifies that a HTTP URL is properly formatted, eg it begins with http:// or https://, the hostname, port and username/password protocol part is followed by a slash, the port number is in the proper range for TCP ports, etc. Note that this function explicitly checks for HTTP urls, eg 'mailto:info@webhare.net' is a valid URL, but not a valid HTTP URL.