THttp:Get
|
NAME
Get - get a remote page
SYNOPSIS
Get( cPage, aPair )
PURPOSE
Get a remote page
EXAMPLE
#include "common.ch"
*----------------------------------------------------
FUNCTION Main( cProxy, nProxyPort )
*----------------------------------------------------
LOCAL oSock
LOCAL cRet
LOCAL cServer := "www.google.com" // "localhost" //
LOCAL nPort := 80 // 8080 //
DEFAULT nProxyPort TO "8080"
oSock := THttp():New()
IF cProxy!=NIL
oSock:SetProxy( cProxy, VAL(nProxyPort) )
ENDIF
? "Connect to " +cServer +":" +alltrim(str( nPort ))
IF oSock:Connect( cServer, nPort )
? "Connected"
? "Get homepage"
? oSock:Get( "pippo:pluto@/" )
? "Close connection"
IF oSock:Close()
? "Close successfull"
ELSE
? "Error on close connection"
ENDIF
ELSE
? "Refused"
ENDIF
RETURN( NIL )
SEE ALSO