Query website save response

Post Reply
User avatar
cdmmaui
Posts: 653
Joined: Fri Oct 28, 2005 9:53 am
Location: The Woodlands - Dallas - Scottsdale - London
Contact:

Query website save response

Post by cdmmaui »

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
User avatar
rhlawek
Posts: 165
Joined: Sun Jul 22, 2012 7:01 pm

Re: Query website save response

Post by rhlawek »

I use this for quick access. Must link in hbtip and call InetInit() somewhere in your code.

Code: Select all

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
User avatar
cdmmaui
Posts: 653
Joined: Fri Oct 28, 2005 9:53 am
Location: The Woodlands - Dallas - Scottsdale - London
Contact:

Re: Query website save response

Post by cdmmaui »

Hi Robb,

Thank you!
*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Post Reply