Brekeke SIP Server Wiki

$webGet

Get web content

Note: $webget method is available in the Advanced and upper Editions only.

 

Syntax:
$webGet( HTTP-URI )
$webGet( HTTP-URI, regex )
$webGet( HTTP-URI, regex, TimeoutConnect )
$webGet( HTTP-URI, regex, TimeoutConnect, TimeoutRead )
$webGet( HTTP-URI, regex, TimeoutConnect, TimeoutRead, FlagAcceptanycert )
Parameters:

HTTP-URI – web site’s URI
regex – a regular expression pattern. It should contain a pair of brackets for defining the matched string
TimeoutConnect – a timeout for connecting. The default is 2000 [ms]
TimeoutRead – a timeout for reading. The default is 2000 [ms]
FlagAcceptanycert – it true, accept TLS certificate without validation

 

Returns:

If the regex is specified, return the matched web content.
Otherwise, return the first line of the web page.

 

Version Since:

2.0

 

Where the function can be used:
  • Preliminary rules
  • Regular rules

 

Example:
$webGet( "http://www.foo.com/","<B>(.+)</B>") = (.+)

Get the string enclosed with <B> and </B> from the specified web site.

$webGet( "https://www.foo.com/","<B>(.+)</B>") = (.+)

Use HTTPS

$webGet( "https://www.foo.com/","<B>(.+)</B>",,,true) = (.+)

Use HTTPS without certificate validation

 

See Also:

$soapGet 
More about $webGet 

Yes No
Suggest Edit