Five Stars

tHttpRequest component and "Post parameters from file"

I am trying to use tHttpRequest component to upload files. Following are my basic setting in the component and also my "Post parameters from file". It looks like I am not passing the file in proper format. Could somebody pls help me to understand what I am doing wrong?

 

tHttpRequest.GIF

POST parameters from file:

auth="<authHeader xmlns=\"http://www.abc.com/api/xsd/2014-04-03\">
<user>xyz@abc.com</user>
<password>???</password>
<appName>Test_App</appName>
<appVersion>1.0</appVersion>
</authHeader>"&param1="<PostParam xmlns=\"http://www.abc.com/api/xsd/2014-04-03\">
<cHandle>c|59999</cHandle>
<jobName>testjob</jobName>
<description>Test image</description>
<destFolder>folder/folder1/folder2/</destFolder>
<fileName>Test.jpg</fileName>
<endJob>true</endJob>
</PostParam>"&uploadfile=\"C:\images\Test.jpg\"

 

This POST request works fine from Postman.

 

Thanks.

  • Data Integration
1 REPLY
Community Manager

Re: tHttpRequest component and "Post parameters from file"

Hi
The content of file should be json format, please refer to the scenario of tHttpRequest in the component documentation.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business