#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL cUrl := "https://www.nonsolocap.it/cap?k=calori&b=&c=bologna"
LOCAL cRes := GETURL( cUrl )
MEMOWRIT( "Response_Test.htm", cRes, .F. )
RETURN NIL
#command IF <condition> THEN <*statements*> => if <condition> ; <statements> ; end
STATIC FUNCTION GETURL( cUrl, oHtp )
LOCAL cRes
TRY
DEFAULT oHtp := CREATEOBJECT( "MSXML2.XMLHTTP" )
oHtp:Open( "GET", cUrl, .F. )
oHtp:Send()
IF oHtp:Status != 200 THEN BREAK
cRes = oHtp:ResponseText
CATCH
END
RETURN cRes
Enrico Maria Giordano wrote:Prova questo esempio:
- Code: Select all Expand view
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL cUrl := "https://www.nonsolocap.it/cap?k=calori&b=&c=bologna"
LOCAL cRes := GETURL( cUrl )
MEMOWRIT( "Response_Test.htm", cRes, .F. )
RETURN NIL
#command IF <condition> THEN <*statements*> => if <condition> ; <statements> ; end
STATIC FUNCTION GETURL( cUrl, oHtp )
LOCAL cRes
TRY
DEFAULT oHtp := CREATEOBJECT( "MSXML2.XMLHTTP" )
oHtp:Open( "GET", cUrl, .F. )
oHtp:Send()
IF oHtp:Status != 200 THEN BREAK
cRes = oHtp:ResponseText
CATCH
END
RETURN cRes
EMG
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 114 guests