
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Upload of a CSV File using tRestClient HTTP PUT method : HTTP 411 Length Required error
Hi,
I need to upload a CSV File using HTTP PUT method. I'm using the tRestClient component, as recommended for deployment to Talend Runtime. As of now, I'm stuck with the HTTP 411 "Length Required" error. Here is my job :
I tried with Postman and the PUT request works successfully :
curl -L -X PUT [confidental url] -H 'Content-Type: text/plain' --data-binary '@/C:/Users/VO2GROUP/Documents/tmp/test_202109301856.txt'
I would prefer to avoid using other components like tFileFetch
(apparently deprecated in studio version 7.3),
tRest (unadvised for deployment to Talend Runtimecf. https://help.talend.com/r/fr-FR/7.3/rest/trest)
or thttprequest.Would you please have a solution using the tRestClient component, with PUT method, and a CSV input file to be uploaded ?
Best regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in addition, the PUT method is not supported by the tFileFetch or tHttprequest components (studio v7.3).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
here is the API documentation :
https://developers.files.com/#file-uploading
I'm currently stuck at step 2 (the PUT method to upload the file)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
updates on my latest trial, I have :
1/ changed the type of the input file to document (in tConvertType) and linked it to the body (instead of the string) of the PUT request (in tMap)
2/ changed the content type in the tRestClient to text/plain. Not in the header definition, but directly in the basic settings (I used Jobscript editor, the value is not natively supported, but it runs and that is what I have in Postman)
3/ also added the content type to text/plain in the header (tRestClient > advanced settings)
Could use a little help, please.
Best regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
can someone help me please ?
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
did you manage to send a file with tRESTClient and the PUT method.
I've looked through the community but haven't found anything conclusive.
Since I have to send the file with the PUT method, I can't use tFileFetch.
On my side also works with Postman/CURL

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Finally I did a bit of digging, I'm not java developper, but I managed to upload an image trought the PUT method with a tJava
In the LibraryLoad :
- httpmime
- commons-logging
- httpcore
- httpclient
The tJava (HttpGet) is a poc to test the imports and the get (source : https://mkyong.com/java/apache-httpclient-examples/)
The last tJava (HttpPut) is the thing
Basic settings
Advanced settings
