I am trying to use tREST to upload/update files. I could use tFileFetch. But, that supports only POST, not GET and PUT.
How can I pass the filename in the body and also how to pass the username/password authentication credential (the Basic authentication)?
Appreciate your help.
You can use a global variable "FileName" to store the filename and then in the body just do: (String) globalMap.get("FileName")
To use basic authentication add a HTTP Header as follow
value: "Basic urlEncodedText"
The urlEncodedText would be [user]:[password] url encoded
To get the encoded text you can run this java code in one of the online java sites as: https://www.compilejava.net/
str = "[user]:[password]";
str = Base64.getUrlEncoder().encodeToString(str.getBytes());
System.out.println("encoded value is " + str);
Hope it helps
I tried tREST with the settings as shown below. But its not working. Am I doing something wrong here?
I am trying to upload jpg images.
The below article is calling REST service to load a png file. It will require some custom code but this should help you to perform your task to upload image files. Could you please try it?
Nikhil, thanks for the suggestion. But this doesn't work for me. I followed the article, but it throws bunch of compilation errors even with the jars uploaded.
As I mentioned before, I am able to upload file using "POST" in tFileFetch. Now, I also need file "PUT" option. Are there any other options to accomplish that?
Appreciate the help.
I am actually using tFileFetch to POST a file. That works fine. However, I also need option for "PUT" method. tFileFetch supports only POST.
Any other suggestion?
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Watch the recorded webinar!
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema
Pick up some tips and tricks with Context Variables