Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I use the tRestClient component to execute a GET on an API to get a picture in the answer.
I tried with Postman and i got a binary file with the extension ".bin".
If i rename this file with the extension ".jpg" i can see the picture.
But in Talend with tRestClient i can't generate the correct picture.
I tried to do this :
tRestClient => tmap => tFileOutputRaw
In the tmap i choose only the string (and not statusCode and body). In the tFileOutputRaw i generated a file. But it's not a picture. The size of this file is 24 ko. And with my test on Postman the size of the file is 25 ko. If i rename the file generated with the extension ".jpg" it isn't a picture.
Thank you very much for your help.
Have a good day
maybe try to use all the header parameter postman use for the call and see what you have in encoding format response without JVM encoding force.
Hi, I think you can use tfileFetch component instead of tRestClient component. It will write directly the response into a file.
I just tried and it's ok with the tFileFetch component.
Thanks for all your messages and your help. Thank you very much.
Hello, I have the same problem as yours'. The authentication of API is Bearer token, not use+password, I couldn't use tFileFetch to get the picture. Do you have an idea?
Thanks a lot.
Hi , have you tried to add a header parameter :
key : "Authorization" value : "Bearer " + your token
?
Send me Love and Kudos
Yeah then when I execute, I got this error "Exception in component tFileFetch_1 (...)
java.lang.Exception: Method failed: HTTP/1.1 405 "