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.