Curl 使用JIRA REST API创建问题时出错
我试图使用JIRA API创建一个问题,我试图使用curl发布此问题:Curl 使用JIRA REST API创建问题时出错,curl,jira-rest-api,http-status-code-400,Curl,Jira Rest Api,Http Status Code 400,我试图使用JIRA API创建一个问题,我试图使用curl发布此问题: curl -D- -u username:password -X POST --data filename.txt -H "Content-Type: application/json" https://<JIRA_BASEURL>/rest/api/2/issue/ 我犯了一个我无法理解的错误 HTTP/1.1 400 Bad Request Server: nginx Date: Tue, 03 May 2
curl -D- -u username:password -X POST --data filename.txt -H "Content-Type: application/json" https://<JIRA_BASEURL>/rest/api/2/issue/
我犯了一个我无法理解的错误
HTTP/1.1 400 Bad Request
Server: nginx
Date: Tue, 03 May 2016 09:57:03 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
X-AREQUESTID: 174x4470x1
X-ASEN: SEN-34722393
X-Seraph-LoginReason: OUT
X-Seraph-LoginReason: OK
X-ASESSIONID: jhs5ewrt4bh
X-AUSERNAME: username
X-ATENANT-ID: jira.atlassian.net
Cache-Control: no-cache, no-store, no-transform
X-Content-Type-Options: nosniff
Set-Cookie: JSESSIONID=41A2A4ABC78BDABCA7B13FB45E3; Path=/; Secure; HttpOnly
Set-Cookie: studio.crowd.tokenkey=""; Domain=.jira.atlassian.net; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly
Set-Cookie: studio.crowd.tokenkey=65IUtfdCjefQ8UlVlh00; Domain=.jira.atlassian.net; Path=/; Secure; HttpOnly
Set-Cookie: atlassian.xsrf.token=BLSG-CYWX-OPRE-Y0WF|e3453a213679767e6370dt637e97f58|lin; Path=/; Secure
{"errorMessages":["Unrecognized token 'fieaett': was expecting 'null', 'true', 'false' or NaN\n at [Source: org.apache.catalina.connector.CoyoteInputStream@fb9e08; line: 1, column: 26]"]}
有人能帮我解决这个问题吗?我想:
命令
curl -D- -u username:password -X POST --data-binary "@filename.txt" -H "Content-Type: application/json" https://<JIRA_BASEURL>/rest/api/2/issue/
这是有效的:)
curl -D- -u username:password -X POST --data-binary "@filename.txt" -H "Content-Type: application/json" https://<JIRA_BASEURL>/rest/api/2/issue/
{
"fields": {
"project":
{
"key": "TEST"
},
"summary": "REST ye merry.",
"description": "Creating of an issue using project keys and issue type names using the REST API",
"issuetype": {
"name": "Bug"
}
}
}