Writing output file from response from HTTP client
Hello all,
I have a HTTP Client snap that returns a file as response (it's a legacy Word .doc file), and I can't seem to be able to save it correctly as binary file.
The results returned by the call is actually the binary content of the file. When I used Python or Postman to validate the response, saving the response directly in a file worked perfectly, I received a valid Word 97 .DOC document.
I'm facing some issues with SnapLogic, although I can see that the response from the HTTP call is correct:
The value of the key "entity" is actually what I want to save directly as binary file.
I then use a mapper to get only the value that I need:
Then I convert the document to binary:
And I use the file writer to generate the document:
The document that I generate is unfurtunately not valid.
Is there a way to save binary documents when they come directly as a response from an HTTP call?
Thanks in advance!
JF
jfpelletier - I tested a similar use case, downloading a sample PDF from https://www.africau.edu/images/default/sample.pdf using the HTTP Client snap, using GET request method. Note that by changing the output view type to Binary in the HTTP Client snap "Views" tab, you can go directly to the File Writer and you get a valid output file.
Hope this helps!