Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

error when using tSystem with cURL to HTTP POST a single json file

The tHttpRequest_1 is broken in in 5.6.1 to HTTP POST a single json file (see # 31574)
As work around I am using a tSystem to do pass the JSON file via cURL. My command is the following:
"curl -X POST -d 'data={\"status\":"+row24.status+",\"details\":\"+row24.details+"\"}' " +context.url

and the answer from the service is
{"success":false,"error":"Missing POST data"}


The same command from my terminal (linux) works great.
I tried to replace all my context variable with test data for debugging purpose -  without success
Any idea why the POST data are not recognized when using tSystem?
Labels (3)
2 Replies
Anonymous
Not applicable
Author

There are some possible problems. At first there is a difference between running a script within the linux shell (with all environment variables set and tSystem which has a shell without these env vars.
Did you tried the component tRESTClient or tHttpRequest? I would say this much more reliable than depending to have curl available.
Anonymous
Not applicable
Author

Thanks for the answer.
As said before the tHttpRequest is broken in talend v 5.6.1.
I've tried the tRestClient but our web service on the other side doesn't want to recognize the data posted. I am now trying to figure out if this come from my configuration of the tRestClient or our web service.