This might be late, but might help others. In http/rest client one can use encoding ISO-8859-1 This retains the binary format. One can then also save to text file using same encoding and the fast data dump option with all content in a single field.
------------------------------
Maple Systems
------------------------------
Original Message:
Sent: 04-30-2024 09:58
From: Ezra Wise
Subject: What is the data type returned for 'Result field name' of the "REST client" step? Can it be binary?
Although I never received an answer to this question, I thought I'd pass along my findings in case someone else finds it useful. The 'Result field name' does convert the content received in the response body and does not preserve its original binary format (if binary is returned). I do not know if there is a way to force the data type to binary. I was able to work around this apparent limitation by using a "User Defined Java Class" step and the 'httpconnect' method to return the rest response as binary.
------------------------------
Ezra Wise
Systems Engineer
RightStar Inc.
Original Message:
Sent: 04-03-2024 15:11
From: Ezra Wise
Subject: What is the data type returned for 'Result field name' of the "REST client" step? Can it be binary?
Hello,
I'm hoping someone can answer this question since I haven't found anything in the documentation. I ask because it appears that PDI is stepping on the raw binary contained in the REST response - perhaps assuming a string value? I'm just looking for some confirmation and whether there is a way to accept the response as binary and not a string. The response header indicates that the Context-Type is "application\octet-stream".
Using Postman I'm able to save the response directly to a binary (*.jpg) file and it works fine. Using PDI Rest client step the file is approximately 1k smaller in size, throws "unsupported file type" errors when trying to view, and it appears that most of the characters I see with Postman are instead converted to '?' (question marks) in the PDI output.
Is there a way to make sure that the Rest client 'Result field name' response output is preserved as binary?
Thanks,
--Ezra
------------------------------
Ezra Wise
Systems Engineer
RightStar Inc.
------------------------------