THttp:Post
|
![]() ![]() ![]() |
NAME
Post - post some value to a page
SYNOPSIS
Post( cPage, aPair )
PURPOSE
post some value to a page
EXAMPLE
#include "common.ch"
*----------------------------------------------------
FUNCTION Main( cProxy, nProxyPort )
*----------------------------------------------------
local oSock, 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