tHttpRequest component and "Post parameters from file"

Highlighted
Six 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.

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

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog