Bug 2535

HTTPClient is truncating the response text 22 November, 2020

Roland Smith
28 March, 2019
Product: PowerBuilder Category: Other
Version: 2017 R3 Build:
Classification: Publishing: Public
Priority: P3
Status: Verifying Reason:
Ken Guo @Appeon 22 November, 2020
Hi Roland,

I used PB 2019 R2 to verify your case just now and found that even though there is no encoding parameter is assigned, it will still return ‘1234’.
It should be that this issue has also been fixed when we fixed some other related issues in PB 2019 R2. I suggest you use PB 2019 R2 to test and see if the issue is gone.

Besides, if there is no encoding parameter assigned in the GetResponseBody function, it will be auto identified so there is no default value.

Roland Smith 21 November, 2020
I'm using WinHttp functions within the C++ code that is part of the app so I'm not using HttpClient.

I checked the documentation at that URL and in 2019-R2 on my laptop and I do not see any mention of the default encoding.
Ken Guo @Appeon 20 November, 2020
Hi Roland,

I would like to check with you if the response provided has been helpful enough
to resolve your case. If so, can we proceed to close the ticket?
Otherwise, do let us know if we can provide you with any further assistance and
keep in mind that you are always welcome to open another ticket in case you
need it.

Chris Pollach @Appeon 01 April, 2019
Great news Ken .. thanks!
Ken Guo @Appeon 01 April, 2019
Hi Roland,

Thanks for your feedback.
Actually, it has been added in PB 2019 Help, please refer to the below link for more details:

Chris Pollach @Appeon 29 March, 2019
Hi Roland;

  You are 100% correct .. the documentation does not specify the default! My guess is that its EncodingUTF16LE!

 I will now pass this ticket over to the Documentation Team to add the default encoding to the PB Help for the "GetResponseBody" command.

Regard ... Chris
Roland Smith 28 March, 2019
Since the SendRequest function defaults to EncodingUTF8!, I assumed that the GetResponseBody would as well.

The help for GetResponseBody doesn't say what the default is. I think it should be changed to default to EncodingUTF8!,
Chris Pollach @Appeon 28 March, 2019
Note: lnv_http.GetResponseBody ( ls_recvdata, EncodingUTF8! ) also works OK as well.
Chris Pollach @Appeon 28 March, 2019
Hi Roland;

It works OK for me by changing ....

lnv_http.GetResponseBody ( ls_recvdata )
- to -
lnv_http.GetResponseBody ( ls_recvdata, EncodingANSI! )

Regards ... Chris
Chris Pollach @Appeon 28 March, 2019
Thanks Roland!
Roland Smith 28 March, 2019
testcase.zip (33KB)

Here is my test case. Place the file truncate.asp in C:\inetpub\wwwroot.

The file truncate.asp is a Classic ASP text file. You can easily change it to return a different number of characters.
Chris Pollach @Appeon 28 March, 2019
Hi Roland;

  If you have an HTTPClient and a WinHTTP test case that you can attach to this ticket and let us know the URL(s) you were using in order for Appeon to try & recreate this issue. That would be super!

Regards ... Chris
Roland Smith 28 March, 2019
I'm using HTTPClient with a URL that points to a web app that returns data based on values in the querystring (the arguments at the end of the URL).

I found that if the response is 4 or less characters, the last character is truncated. I discovered this with a web app which returns either 'true' or 'false' and my desktop app only received 'tru'. If the web app returned 'false', my desktop app received the full string.

I tested with HTTPClient, my WinHTTP example app, and the Msxml2.XMLHTTP OLE control. Only HTTPClient had this behavior.

The Content-Type set by the web app is 'text/plain'.
Database Type:
Database Version: