This is the another working example of posting datas using TIP class.
- Code: Select all Expand view RUN
#include "FiveWin.ch"
PROCEDURE Main
LOCAL oDlg
DEFINE DIALOG oDlg
@ 2,1 BUTTON oBtn PROMPT "Post Data to FiveTech" ACTION POST()
ACTIVATE DIALOG oDlg CENTERED
RETURN
PROCEDURE POST()
LOCAL oHttp, cHtml, hQuery, aLink, oNode, oDoc
oHttp:= TIpClientHttp():new( "http://www.fivetechsoft.com/secure/english/test.php" )
hQUery := Hash()
hSetCaseMatch( hQuery, .F. )
hQuery["first"] := "fivewin"
hQuery["last"] := "FiveTech Software"
// Connect to the HTTP server
IF .NOT. oHttp:open()
? "Connection error:", oHttp:lastErrorMessage()
QUIT
ENDIF
oHttp:Post(hQuery)
cHtml := oHttp:readAll()
oHttp:close()
oDoc := THtmlDocument():new( cHtml )
oDoc:writeFile( "download.html" )
msgInfo("Look at the download.html in this directory.")
RETURN