Use this method to 'ping' a Web site that is known to be up to check whether a valid Internet Connection can be made. You can specify a timeout value that determines how long this request runs and waits for finding the site in question.

Syntax:

o.HTTPPing(lnTimeout,lcUrl)
Return: .T. or .F. On error cErrorMsg is set with an error number string.
Parameters: lnTimeout
Timeout in seconds.

lcUrl
A fully qualified URL that you want to check.

Examples:
http://www.west-wind.com
https://www.west-wind.com:443/default.aspx

lcServer and lcLink
For backwards compatibility the lcUrl and lcLink parameters can be used to pass a server name and server relative page path.

Example:
Http.HttpPing(5,"www.west-wind.com","/default.asp")

Example:
oIP = CREATEOBJECT("wwHttp")

*** Optionally - set any oIP Connection options
oIP.cUsername = "ricks"
oIP.cPassword = "supersecret"

IF !oIP.HTTPPing(5,"http://www.west-wind.com/somepage.htm")
   MessageBox("No Connection")
   RETURN
ENDIF

Remarks: This routine is not a PING like operation, but it works only over the HTTP protocol. You can use this routine to check for an Internet Connection by accessing a known up site (such as Microsoft.com or Yahoo.com).

See also:

Class wwHTTP

Updated: 7/11/2005 | Send topic feedback