2016-06-09 134 views
0

我已成功創建Jira Issue,現在想要使用以下內容添加附件:api/2/issue/{issueIdOrKey}/attachments使用:api/2/issue/{issueIdOrKey} /附件添加附件

我的下面的VB代碼不會工作,任何建議,因爲這對我來說是新的,謝謝。我得到的錯誤是:HTTP狀態500 - 錯誤解析的Content-Type

子JIRA_PostAttachment()

昏暗PHTML作爲字符串 昏暗oHttp作爲對象 昏暗strResponse作爲字符串

PHTML = 「https://jira.ae.sda.corp.test.com/rest/api/2/issue/IS-163/attachments」 SVAR = 「」 「文件=」 「: 」「 C:\用戶\ c776469 \ FORM.msg」 「」

Set oHttp = CreateObject("Microsoft.XMLHTTP") 
Call oHttp.Open("POST", pHtml, False) 
'oHttp.SetRequestHeader "Content-Type", "application/json" 
oHttp.SetRequestHeader "Content-Type", "multipart/form-data;Charset=UTF-8; boundary=" 
'oHttp.SetRequestHeader "Accept", "application/json" 
oHttp.SetRequestHeader "X-Atlassian-Token", "no-check" 

oHttp.SetRequestHeader "Authorization", "Basic Yzc4NjQ3OTpHaWxpdDIwMTY/" 

Call oHttp.Send(sVar) 

strResponse = oHttp.ResponseText 
MsgBox strResponse 

Set oHttp = Nothing 

結束子

回答