如何使用Talend tREST上传文件? [英] How to Upload files using Talend tREST?

查看:418
本文介绍了如何使用Talend tREST上传文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专家

我需要使用Talend tREST组件将文件上传到Zephyr/JIRA.我不知道在httpbody部分中提供的格式/语法,例如curl的(-F"file=@myfile.txt")

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

我在正文部分给出了完整的路径和文件名. 运行时,我得到ERROR_CODE = 500.

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

在tREST的正文部分,请提供有关如何提供文件路径/文件名的帮助.

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

我在Zephyr/Zapi API网站上没有足够的信息.

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

预先感谢-PK

现在,我尝试使用tFileFetch使用图片中所示的参数..但是我仍然收到方法失败:HTTP/1.1 500 Internal Server Error".有人可以帮忙吗?

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?

推荐答案

您可以使用tFileFetch组件来下载文件,但是在其高级设置中,您可以启用上传文件",然后上传文件.作为奖励,它会在一个包含多个部分的http帖子中执行该操作.

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.

查看更多: https://help.talend.com/display/TalendComponentsReferenceGuide61EN/tFileFetch

这篇关于如何使用Talend tREST上传文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆