checking an url
Posted: Fri Oct 23, 2020 8:16 am
Hello,
To check an url, I use this function :Why is this function working fine while using an url starting with "http://" and why is it not working with "https://"?
In that case I got an error on the TipClienthttp:new() function.
Anyone any idea?
Thank you.
To check an url, I use this function :
Code: Select all
STATIC FUNCTION wfReadURL(cUrl,cNr,dUrl)
LOCAL cFile := SUBSTR(cUrl,RAT("/",cUrl)+1)
LOCAL cExist := .F.
LOCAL oUrl,oCli
DEFAULT(dUrl,"")
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 PAR->TESTNOTRY
cExist := "OK" $ UPPER(oCli:cReply)
ELSE
TRY
cExist := "OK" $ UPPER(oCli:cReply)
CATCH
cExist := .T.
END
ENDIF
oCli:Close()
END SEQUENCE
RETURN(cExist)
In that case I got an error on the TipClienthttp:new() function.
Anyone any idea?
Thank you.