Hi all,
I need to execute an http string like this:
http://condominio.emessage.it/CheckAgen ... word=pluto
and obtain the result html code.
How can I make this ?
Thanks in advance
FUNCTION MAIN()
? GETURL( "http://condominio.emessage.it/CheckAgent.aspx?Userid=pippo&Password=pluto" )
RETURN NIL
FUNCTION GETURL( cUrl )
LOCAL cFile := SUBSTR( cUrl, RAT( "/", cUrl ) + 1 )
LOCAL oUrl, oCli
LOCAL lOk := .F.
IF "?" $ cFile
cFile = LEFT( cFile, RAT( "?", cFile ) - 1 )
ENDIF
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
lOk = "OK" $ UPPER( oCli:cReply )
oCli:Close()
IF !lOk; FERASE( cFile ); ENDIF
END SEQUENCE
RETURN lOk
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 83 guests