Generated from ././ with ROBODoc v4.0.24 on Sat Feb 19 09:57:31 2005

TABLE OF CONTENTS

1. TDecode/TDecode

[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

1.1. TDecode/TDecode:Decode

[top][parent]

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

1.2. TDecode/TDecode:new

[top][parent]

NAME

    new - class costructor

SYNOPSIS

    TDecode():new()

PURPOSE

    Create a new TDecode object

EXAMPLE

    oSock := TDecode():new()

2. TFtp/TFtp

[top]

NAME

    TFtp

PURPOSE

    Create a FTP connection

METHODS

    TFtp:New
    TFtp:Connect
    TFtp:Login
    TFtp:Close
    TFtp:List

EXAMPLE

SEE ALSO

    THttp

3. THttp/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

3.1. THttp/THttp:Connect

[top][parent]

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

3.2. THttp/THttp:Get

[top][parent]

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

3.3. THttp/THttp:Post

[top][parent]

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

4. TPair/TPair

[top]

NAME

    TPair

PURPOSE

    Create a couple

METHODS

    TPair:New

EXAMPLE

SEE ALSO

    TPair:TDecode

5. TPop3/TPop3

[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

5.1. TPop3/TPop3:Login

[top][parent]

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

5.2. TPop3/TPop3:new

[top][parent]

NAME

    new - class costructor

SYNOPSIS

    TPop3():new()

PURPOSE

    Create a new TPop3 object

EXAMPLE

    oSock := TPop3():new()

6. TSMTP/TSMTP

[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

7. TSocket/TSocket

[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