I use this code to check if a website exists or not.
- Code: Select all Expand view
- FUNCTION wfReadURL(cUrl)
LOCAL cFile := SUBSTR(cUrl,RAT("/",cUrl)+1)
LOCAL cExist := .F.
LOCAL oUrl,oCli
cUrl := LOWER(cUrl)
BEGIN SEQUENCE
oUrl := TUrl():New(cUrl)
IF EMPTY(oUrl) ; BREAK ; ENDIF
oCli := TIPClientHttp():New(oUrl) ***
IF EMPTY(oCli) ; BREAK ; ENDIF
IF !oCli:Open() ; BREAK ; ENDIF
IF !oCli:ReadToFile(cFile) ; BREAK ; ENDIF
IF PAR1->TESTNOTRY
cExist := "OK" $ UPPER(oCli:cReply)
ELSE
TRY
cExist := "OK" $ UPPER(oCli:cReply)
CATCH
cExist := .T.
END
ENDIF
oCli:Close()
END SEQUENCE
RETURN(cExist)
It works fine for "http://" urls, but if I use to check it for a "https://", I got this error:
- Code: Select all Expand view
- Error BASE/1081 Operation not supported: TIPCLIENTHTTP:new()
I need this function to work for https. Who can I do this?
Thanks.