来自Angular 4项目的HTTP POST请求引发错误403

来自Angular 4项目的HTTP POST请求引发错误403,angular,http,post,jira,Angular,Http,Post,Jira,我正在尝试执行HTTP POST请求,以使用Angular4创建JIRA发行票据 以下是我正在使用的代码片段: const username = 'username'; const password = 'password'; const params = '{' + '"fields":{' + '"project": {' + '"key": "ABCD"

我正在尝试执行HTTP POST请求,以使用Angular4创建JIRA发行票据

以下是我正在使用的代码片段:

const username = 'username';
const password = 'password';
const params = '{' +
                  '"fields":{' +
                      '"project": {' +
                            '"key": "ABCD" },' +
                        '"summary": "' + this.form.value.summary + '",' +
                        '"description":"' + this.form.value.description + '",' +
                        '"issuetype": {' +
                          '"name" : "' + this.form.value.issuetype + '"},' +
                        '"customfield_10041": {"value": "' + this.form.value.storyType + '"}' +
                      '}' +
                  '}' ; 

const headers = new Headers();
headers.append('Host', 'https://jira-uat.in.here.com');
headers.append('Content-Type', 'application/json');
headers.append('Authorization', 'Basic ' + btoa(username + ':' + password));

return this.http.post('https://someURI/rest/api/2/issue/', params , {headers: headers}).map(res => res.json());
虽然我能够使用POSTMAN(用于测试web服务的HTTP客户端)成功创建JIRA问题,但当我尝试运行Angular项目时,它会抛出以下错误:

 ERROR: Response with status: 403 Forbidden for URL: https://someURI/rest/api/2/issue/
我在这里遗漏了什么

当我试图编译代码时,下面是传递的请求头-

 Accept:application/json, text/plain, */*
 Accept-Encoding:gzip, deflate, br
 Accept-Language:en-US,en;q=0.8
 Authorization:Basic Z**********************h
 Connection:keep-alive
 Content-Length:149
 Content-Type:application/json
 Host:someURI
 Origin:http://evil.com/
 Referer:http://localhost:4200/someRoute
 User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 
 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36
以下是响应标题:

Cache-Control:no-cache, no-store, no-transform
Connection:Keep-Alive
Content-Type:text/html;charset=UTF-8
Date:Tue, 01 Aug 2017 17:35:41 GMT
Keep-Alive:timeout=5, max=99
Server:Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_jk/1.2.41
Set-Cookie:JIRA72ARD1SESSIONID=E558106054FA151216527F0A66C6D204; Path=/; Secure; HttpOnly
Set-Cookie:atlassian.xsrf.token=BO4R-SWLP-WXR5-89O4|b25695ca2bee6fbaa48e9cddcf023d851bfc5bf5|lin; Path=/; Secure
Transfer-Encoding:chunked
X-AREQUESTID:1055x68000x1
X-ASEN:SEN-2026451
X-ASESSIONID:c993lp
X-AUSERNAME:username
X-Content-Type-Options:nosniff
X-Seraph-LoginReason:OK

不确定是什么问题导致了这个问题

JIRARESTAPI应该在响应内容中提供更详细的错误描述。我不熟悉Angular,但是应该有一种方法可以在不抛出错误的情况下读取此响应内容。JIRA REST API应该在响应内容中提供更详细的错误描述。我不熟悉Angular,但应该有一种方法可以在不抛出错误的情况下读取此响应内容。