ReadData
PowerScript function
Description
Reads the response body.
Applies to
HTTPClient object
Syntax
|
1 |
objectname.ReadData ( data, bufferSize ) |
|
Argument |
Description |
|---|---|
|
objectname |
The name of the HTTPClient object for which you want |
|
data |
A blob value into which the function returns |
|
bufferSize |
A long value specifying the buffer |
Return value
Integer.
Returns values as follows. If any argument’s value is null, the
method returns null.
1 — Success
0 — Reading data is finished
-1 — General error
-2 — Timed out
Examples
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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 |
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest