FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Query website save response
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Query website save response
Posted: Tue Aug 11, 2015 01:28 PM

Good Day Everyone!

Does anyone have a sample code they can share where a website is queried and response saved?

Thank you in advance for your help!

Sincerely,

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 195
Joined: Sun Jul 22, 2012 07:01 PM
Re: Query website save response
Posted: Tue Aug 11, 2015 02:02 PM
I use this for quick access. Must link in hbtip and call InetInit() somewhere in your code.

Code (fw): Select all Collapse
FUNCTION GETURL( cURL, nBytes )

   LOCAL cRetValue := ""

   hb_default( @nBytes, 00 )

   WITH OBJECT TIPClientHTTP():new( cURL )
      IF :open()
         :Get()
         IF nBytes == 00
            cRetValue := :readall()
         ELSE
            cRetValue := :read( nBytes )
         ENDIF
      ENDIF
      :close()
   END

   RETURN ( cRetValue )


Robb
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Query website save response
Posted: Tue Aug 11, 2015 03:14 PM

Hi Robb,

Thank you!

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com

Continue the discussion