How to Upload files using Talend tREST?

 ̄綄美尐妖づ 提交于 2020-01-13 05:20:07

问题


Experts,

I need to upload files using Talend tREST component to Zephyr/JIRA. I do not know the format/syntax to give in httpbody section like the curl's ( -F "file=@myfile.txt" )

URL
 https://localhost:4000/jira/rest/zapi/latest/attachment?  
 entityId=4783&entityType=TestStepResult

BODY
 D:/TestResults/QPJ-707_Count_Mismatch.xls

I gave the full path and file name in body section. When I run, I am getting ERROR_CODE = 500.

Please help on how to give filepath/filename in the body section in tREST.

I do not get enough information in Zephyr/Zapi API website.

thanks in Advance - PK

Now, I tried with tFileFetch with the parameters as shown in the pics.. but I still get "Method failed: HTTP/1.1 500 Internal Server Error". Could someone help on this please?


回答1:


You can use the tFileFetch component that allows you to download files, however in its advanced settings you can enable the "upload files" which then uploads the files. As a bonus it does it in a multi-part http post.

See more: https://help.talend.com/display/TalendComponentsReferenceGuide61EN/tFileFetch




回答2:


In case if tFileFetch is not working for you, you can use tRest component to upload file to a rest api. An example is given here



来源:https://stackoverflow.com/questions/38164930/how-to-upload-files-using-talend-trest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!