AutoReadData

Applies to

HTTPClient objects

Description

When the AutoReadData property is enabled, the program reads the response body automatically. Values are:

TRUE – (Default) The program reads the response body automatically.

FALSE – The program will not read the response body automatically.

Usage

In a painter

To read the response body automatically:

  • Select the AutoReadData check box on the General page of the object's Properties view.

In scripts

The AutoReadData property takes a boolean value.

Integer li_rc
Blob lblb_photo, lblb_NextData
HttpClient lnv_HttpClient 

lnv_HttpClient = Create HttpClient

// Not to read data automatically after sending request (default is true)
lnv_HttpClient.AutoReadData = false

// Send request using GET method
li_rc = lnv_HttpClient.SendRequest("GET", "http://demo.appeon.com/PB/webapi_client/employee/102/photo")

// Receive large data
if li_rc = 1 and lnv_HttpClient.GetResponseStatusCode() = 200 then
 do while true
  li_rc = lnv_HttpClient.ReadData(lblb_NextData, 1024*16)
  if li_rc = 0 then exit // Finish receiving data
  if li_rc = -1 then exit // Error occurred
  
  lblb_photo += lblb_NextData
 loop
end if