How to perform a multi-part http post in Talend?

Highlighted
Four Stars

How to perform a multi-part http post in Talend?

I tried tRestClient component to perform a file upload and it failed. I couldn't see the multi-part option in there. I can successfully upload using tFileFetch. Is it possible to write the response to a file when using tFileFetch for POST? Are there any other Talend components that can support multi-part uploads?

Highlighted
Six Stars

Re: How to perform a multi-part http post in Talend?

Hi,

check the cHTTP/cHTTP4 component in Route, should be possible to specify the content type.

 

Mirko

Highlighted
Six Stars

Re: How to perform a multi-part http post in Talend?

But in any case I don't understand why you have to upload a file using a form, instead of posting directly the content.

 

Mirko

Highlighted
Four Stars

Re: How to perform a multi-part http post in Talend?

This is what I trying to achieve in Talend. The reason I need multipart-form is that's what the server what I'm uploading to supports Screen Shot 2017-04-28 at 15.23.50.png

 

Highlighted
Six Stars

Re: How to perform a multi-part http post in Talend?

I am trying to upload (POST) file using tFileFetch component with multipart/form-data. I am not sure what I am doing wrong, it doesn't work for me.

Here are my screenshots: tFileFetch1.GIFtFileFetch2.GIF

Am I missing something?

Appreciate your help.

Highlighted
Ten Stars

Re: How to perform a multi-part http post in Talend?

What error are you encountering? Or does it complete without errors yet not upload the file?
Six Stars

Re: How to perform a multi-part http post in Talend?

Thanks for your response. 

I get the following response. But its not uploading the file.

==================================

Starting job TestJob at 09:55 15/05/2017.

[statistics] connecting to socket on port 3782
[statistics] connected
[statistics] disconnected
Picked up JAVA_TOOL_OPTIONS: -Djava.vendor="New Oracle"
Job TestJob ended at 09:55 15/05/2017. [exit code=0]

=======================================

Highlighted
Six Stars

Re: How to perform a multi-part http post in Talend?

Now I get the following response after restarted Talend:

Starting job TestScene7 at 14:09 15/05/2017.

[statistics] connecting to socket on port 3426
[statistics] connected
[INFO ]: org.apache.commons.httpclient.HttpMethodBase - Response content length is not known
Status Line: HTTP/1.1 200 OK
*** Response Header ***
Content-Type: text/xml;charset=utf-8
Content-Length: 233
Date: Mon, 15 May 2017 18:09:10 GMT
Server: Unknown
Connection: close
Picked up JAVA_TOOL_OPTIONS: -Djava.vendor="New Oracle"
[statistics] disconnected
Job TestJob ended at 14:09 15/05/2017. [exit code=0]

But its not uploading the data.

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

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