[top]
NAME
TDecode
PURPOSE
Decode string to pass in GET and POST method
METHODS
TDecode:new
TDecode:Decode
TDecode:Encode
TDecode:Decode64
TDecode:Encode64
TDecode:MD5
TDecode:HMAC_MD5
EXAMPLE
oSock := TDecode():new()
? "Authorization: Basic "+oSock:encode64( "Aladdin:open sesame" )
? "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
SEE ALSO
THttp
NAME
Decode - decode a String
SYNOPSIS
Decode( cString )
PURPOSE
Get a string after a POST/GET operation and transofrm in a valid value
EXAMPLE
oSock := TDecode():new()
? oSock:decode( "hello%20world" ) // "hello world"
SEE ALSO
TDecode:Encode
NAME
new - class costructor
SYNOPSIS
TDecode():new()
PURPOSE
Create a new TDecode object
EXAMPLE
oSock := TDecode():new()
[top]
NAME
TFtp
PURPOSE
Create a FTP connection
METHODS
TFtp:New
TFtp:Connect
TFtp:Login
TFtp:Close
TFtp:List
EXAMPLE
SEE ALSO
THttp
[top]
NAME
THttp
PURPOSE
Create a HTTP connection
METHODS
THttp:New
THttp:Connect
THttp:Close
THttp:SetProxy
THttp:SetUser
THttp:Get
THttp:Post
EXAMPLE
SEE ALSO
TFtp
NAME
Connect - connect to a remote server
SYNOPSIS
Connect( cAddress, nPort )
PURPOSE
Connect to a remote server on cAddress and nPort
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
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, 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
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
THttp:Get
[top]
NAME
TPair
PURPOSE
Create a couple
METHODS
TPair:New
EXAMPLE
SEE ALSO
TPair:TDecode
[top]
NAME
TPop3
PURPOSE
Create a POP3 connection
METHODS
TPop3:new
TPop3:connect
TPop3:close
TPop3:Login
TPop3:list
TPop3:GetMessageHeader
TPop3:GetMessageText
TPop3:DeleteMessage
EXAMPLE
SEE ALSO
TDecode
NAME
Login - login into POP3 server
SYNOPSIS
Login( cUser, cPwd )
PURPOSE
Login into POP3 server
EXAMPLE
oSock := TPop3():New() )
oSock:Connect( "pop3.server-dummy.com", 110 )
oSock:Login( "user", "password" )
SEE ALSO
TPop3:new
NAME
new - class costructor
SYNOPSIS
TPop3():new()
PURPOSE
Create a new TPop3 object
EXAMPLE
oSock := TPop3():new()
[top]
NAME
TSMTP
PURPOSE
Create a SMTP connection
METHODS
TSMTP:new
TSMTP:connect
TSMTP:login
TSMTP:loginMD5
TSMTP:close
TSMTP:cleardata
TSMTP:setfrom
TSMTP:setsubject
TSMTP:addto
TSMTP:addcc
TSMTP:addbcc
TSMTP:setdata
TSMTP:AddAttach
TSMTP:send
TSMTP:GetLastError
EXAMPLE
SEE ALSO
TDecode
[top]
NAME
TSocket
PURPOSE
Create a SOCKET connection
METHODS
TSocket:new
TSocket:connect
TSocket:SendString
TSocket:ReceiveString
TSocket:ReceiveLine
TSocket:ReceiveChar
TSocket:GetLocalName
TSocket:GetLocalAddress
TSocket:Bind
TSocket:Listen
TSocket:SetReceiveTimeout
TSocket:SetSendTimeout
TSocket:SetDebug
EXAMPLE
SEE ALSO
TSMTP