rest api link issue while creating issue

I'm trying to execute CURL command as shown in Jira documents for creating an issue.

I'm using the below command;

curl -D- -u a.b@c.com:myPassword -X POST -data data.txt -H "Content-Type: application/json" http://localhost:8088/rest/api/2/issue/

 

Content of data.txt is as below;

{"fields": {"project":{"key": "CRTQ"},"summary": "Test Summary","description": "This is description","issuetype": {"name": "Bug"}}}

 

Response received;

curl: (3) Port number ended with '\'
HTTP/1.1 400
X-AREQUESTID: 1049x1902x1
X-ASEN: SEN-L10016630
Set-Cookie: JSESSIONID=2599857A6C75D56F1800E2E1F7DB4034;path=/;HttpOnly
X-Seraph-LoginReason: OK
Set-Cookie: atlassian.xsrf.token=BOAQ-4XFZ-EQJV-2T2J|7658a261b648a3a465e0384170dcc1f34c52c016|lin;pa
th=/
X-ASESSIONID: 5wsb8e
X-AUSERNAME: ranjithcnair.in%40gmail.com
Cache-Control: no-cache, no-store, no-transform
X-Content-Type-Options: nosniff
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 03 Aug 2017 11:59:25 GMT
Connection: close

{"errorMessages":["Unexpected character ('a' (code 97)): expected a valid value (number, String, arr
ay, object, 'true', 'false' or 'null')\n at [Source: org.apache.catalina.connector.CoyoteInputStream
@3af078d7; line: 1, column: 2]"]}

 

 

What am I missing or doing wrong?

1 answer

This widget could not be displayed.
Josh Steckler Community Champion Aug 03, 2017

I think your curl command is malformed, try:

curl -i -u a.b@c.com:myPassword -X POST -d @data.txt -H "Content-Type: application/json" http://localhost:8088/rest/api/2/issue/

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 4 hours ago in Featured Groups

Hi! I'm Cameron Deatsch, Head of Server at Atlassian and I'm hosting an AMA next week.

Hey team! I'm Cameron Deatsch, Head of Server at Atlassian. I'll be hosting an AMA over in our Questions section of the Community next Monday, so shoot me your questions, upvote others' question...

22 views 0 2
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you