我尝试通过基本身份验证连接到Jira,如here所述,但有401错误。
此处密码和登录名相同c27115@trbvm.com
我的卷曲
curl -D- -u c27115@trbvm.com:c27115@trbvm.com -X GET -H "Content-Type: application/json" https://jira.atlassian.com/rest/api/2/project
curl -D- -X GET -H "Authorization: Basic YzI3MTE1QHRyYnZtLmNvbTpjMjcxMTVAdHJidm0uY29t" -H "Content-Type: application/json" "https://jira.atlassian.com/rest/api/2/project"
此处回复result。
你能帮助我吗?
答案 0 :(得分:1)
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, username.":".password);
这应该这样做。