Hi Enrico,
your function could be fine but trying to link it I receive the following errors:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_HB_FUN_TURL' referenced from K:\TESTXBRW\OBJ\URL.OBJ
Error: Unresolved external '_HB_FUN_TIPCLIENTHTTP' referenced from K:\TESTXBRW\OBJ\URL.OBJ
Do I need to add any special libs ? I am using the last FWH/xHarbour release.
Thanks
Marco
Enrico Maria Giordano wrote:I'm using the following function to run an URL, return the result page and eventually the error message. I don't know how to get the result code, though.
STATIC FUNCTION RUNURL( cUrl, cErr )
  LOCAL oUrl, oCli
  LOCAL lOk := .F.
  cErr = ""
  BEGIN SEQUENCE
    oUrl = TUrl():New( cUrl )
    IF EMPTY( oUrl ); BREAK; ENDIF
    oCli = TIPClientHttp():New( oUrl )
    IF EMPTY( oCli ); BREAK; ENDIF
    oCli:nConnTimeout = -1
    IF !oCli:Open(); BREAK; ENDIF
    cErr = CVALTOCHAR( oCli:ReadAll() )
    lOk = !EMPTY( oCli:cReply ) .AND. "OK" $ UPPER( oCli:cReply )
    oCli:Close()
  END SEQUENCE
  RETURN lOk
EMG