HTTPS CURL POST command into Talend

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

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch