HTTPS CURL POST command into Talend

Five Stars

HTTPS CURL POST command into Talend

Hello. I have a working CURL command which I'm struggling to replicate in Talend (6.5.1).

 

The working command is :  curl -i -X POST -u username:'password' --data-binary
'@/usr/local/workfiles/import.csv' -H Content-Type:text/plain 'https://xxxxx.net/xxxxxx'

 

- I've tried a tsystem which results in a 401 error (Unauthorized)

- I've also tried a thttprequest which results in a: "message" : "No OpenID authorization header was supplied",   "http_status_code" : 401"  .

Or a 500 if I mess with the username and password.

- I've also tried a tFleFetch which also results in a 401 (unauthorized).

 

I'm unsure if I should be passing the username and password as a header (e.g Authorization = username:'password') or as separate headers (authMethod = Basic, authUsername = username, authPassword = 'Password').   Should the credentials be in the "Need Authentication" box in the tFileFetch and thttprequest.

 

Could anyone possibly help with this?  Screenshots would also be fantastic.

 

Many thanks.

 


Accepted Solutions
Five Stars

Re: HTTPS CURL POST command into Talend

I finally complete this job using a tRest component. 

I failed using a tFileFetch and always received a 400 error.  I managed with a tHTTPRequest in the same way as the tRest.

 

I think my problems were because I was not reading the file as a byte array.  Still not sure what this means but read somewhere that it was required.

 

I also was unsure about converting the username and password to bas64 string.  It was required in this case.


All Replies
Moderator

Re: HTTPS CURL POST command into Talend

Hello,

Are your CURL post command running  fine in command prompt?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: HTTPS CURL POST command into Talend

The command is running successfully from Linux command line. I havnt run it in Windows.
Five Stars

Re: HTTPS CURL POST command into Talend

I finally complete this job using a tRest component. 

I failed using a tFileFetch and always received a 400 error.  I managed with a tHTTPRequest in the same way as the tRest.

 

I think my problems were because I was not reading the file as a byte array.  Still not sure what this means but read somewhere that it was required.

 

I also was unsure about converting the username and password to bas64 string.  It was required in this case.

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

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 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads