我无法使用JIRA rest API(Cookie auth)进行身份验证。尝试了NodeJS的JIRA文档中给出的示例代码。我尝试将HTTP更改为HTTPS。我的请求都没有成功。我在这做错了什么?请指教。
var Client = require('node-rest-client').Client;
client = new Client();
var loginArgs = {
data: {
"username": "admin",
"password": "pwd"
},
headers: {
"Content-Type": "application/json"
}
};
client.post("http://mvpvinay.atlassian.net/jira/rest/auth/1/session", loginArgs, function(data, response) {
if (response.statusCode == 200) {
console.log('succesfully logged in, session:', data.session);
} else {
throw "Login failed :(";
}
});