I am posting a request to an API from a server in Greece.
The content reply header is :application/json; charset=windows-1253
When trying to get the data with GetResponseBody all I get is two unreadable characters.
I have tried using UTF-8 and ANSI but nothing helps.
I installed the Greek language but does not help
On my same computer (even before installing the Greek language) when running the same request in Postman, the reply is ok.
Any help would be appreciated.
d.f.
"A value specifying the encoding type of the string data to be sent: EncodingANSI!, EncodingUTF8!, EncodingUTF16LE!, or EncodingUTF16BE!. If the user sets the encoding charset in the Content-Type request header, this argument will be ignored."
"PowerBuilder should use the response header for determining the character set and not the REQUEST header."
I agree.
if this is not happening (as per what you are seeing), then you should post this as a bug.
Regarding the description of this getResponseBody method, the local PB Help description prevails.
The description on this current web page is incorrect. The correct description should be as follows:
A value specifying the encoding type of the string data to be received: EncodingANSI!, EncodingUTF8!, EncodingUTF16LE!, or EncodingUTF16BE!.
If this argument is set, the encoding charset in the Content-Type response header will be ignored.
We will update the online document. Very sorry for the inconvenience caused!
Currently, this design of PB, unlike Postman, is not quite smart.
We suggest that you can use the Blob argument with GetResponseBody function and see if there’s any difference.
e.g.:
objectname.GetResponseBody ( blob data )
In addition, if you can provide a reproducible PB test case (with PBT / PBL), kindly please report this issue to our ticket system: https://www.appeon.com/standardsupport/newbug so that it can be properly received and tracked.
Regards,