Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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.

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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.


Tal1.JPG
tal2.JPG
tal3.JPG
tal4.JPG
tal5.JPG

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Hello,

Are your CURL post command running  fine in command prompt?

Best regards

Sabrina

Anonymous
Not applicable
Author

The command is running successfully from Linux command line. I havnt run it in Windows.
Anonymous
Not applicable
Author

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.


Tal1.JPG
tal2.JPG
tal3.JPG
tal4.JPG
tal5.JPG