身份validation问题VBA Excel

我正在尝试创build一个cookie /validation我的用户名和密码对JIRA API。 它不工作,因为我得到login被拒绝。 这是我正在使用的代码:

Set JiraAuth = CreateObject("MSXML2.XMLHTTP.6.0") With JiraAuth .Open "POST", "http://website/rest/auth/1/session", False .SetRequestHeader "Content-Type", "application/json" .SetRequestHeader "Accept", "application/json" .Send " {""username"" : ""USER"", ""password"" : ""USERPASSWORD!""}""" sErg = .ResponseText sCookie = "JSESSIONID=" & Mid(sErg, 42, 32) & "; Path=/Jira" '*** Extract the Session-ID End With 

这是我收到的回应:

:{“errorMessages”:[“Login denied”],“errors”:{}},“errors”:{}}

如果我使用IE浏览器,我可以用我给的用户名和密码login。 所以login凭证不是问题。

我需要encryption密码吗?
我怎样才能解决这个/我可以看看的任何例子?

Interesting Posts