1. Rajkumar K S
  2. PowerBuilder
  3. Thursday, 23 November 2023 10:25 AM UTC

Hi Team,

 

In one of our application we are using httpclientrquest to server for downloading azure git source code. The source zip having larger size above 1 GB. When we use the httpclientrquest getting error -1 ( generic error).

 

SendPutRequest
Description

Sends the HTTP PUT request to the server and then gets the content of the server response. It does not parse the HTTP response code and content of the server response.

It is not recommended to use this method to process large data (20 MB or 100,000 data rows can be considered as large data based on our tests).

 

Kindly help us is there any alternate solution to download larger files..

Regards

Rajkumar 

Accepted Answer
Peter Pang @Appeon Accepted Answer Pending Moderation
  1. Friday, 24 November 2023 05:34 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Rajkumar,

 

You can set AutoReadData to false and then read the data manually.

 

Example:

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", "https://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

 

Best Regards,
Peter

 

Comment
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.