我正在尝试使用python请求模块附加带有atlassian jira api的文件。附件成功,但附件名称变为file
,附件缩略图不正确。下面是成功创建票证后jira的附件截图
下面给出了Python代码"Content-type" : "multipart/form-data"
直接从前端javascript代码传递。请注意,atlassian文档提到,包含附件的多部分/表单数据参数的名称必须为file
file = request.files['file']
files = {'file': file.read()}
response = requests.post(JIRA_URL + '/' + path,
headers={'X-Atlassian-Token': 'no-check'},
auth=(JIRA_USER, JIRA_PASS),
files=files,
proxies={'https': PROXY})
我使用jirapython,然后编写如下代码
其中localname是本地文件名,att_filename是您希望在问题中看到的实际文件名
jira python代码中有
这有点棘手。我真的建议使用jirapython,而不是直接使用请求
相关问题 更多 >
编程相关推荐