AutoReadData

Applies to

HTTPClient objects

Description

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

TRUE – 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. The following line sets the AutoReadData property to true:

HttpClient lnv_HttpClient 
lnv_HttpClient = Create HttpClient

// Not to read data automatically
lnv_HttpClient.AutoReadData = false

// Send GET request
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)
  if li_rc = 0 then exit // Finish receiving data
  if li_rc = -1 then exit // Error occurs
 loop
end if