Rish
Rish

Reputation: 457

Error in curl when authenticating into JIRA

curl  -H "Content-Type: application/json; charset=UTF-8" -d '{"username":"admin","password":"admin"}' http://localhost:2990/jira/rest/auth/1/session

I used the above query in DOS and I always get the following error :

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

I tried many permutations and combinations .. Still it did not work ..

Upvotes: 3

Views: 1471

Answers (2)

Tobias Ericsson
Tobias Ericsson

Reputation: 101

Its a windows thing, try to replace ' with " and " with """.

curl  -H "Content-Type: application/json; charset=UTF-8" -d "{"""username""":"""admin""","""password""":"""admin"""}" ...

Upvotes: 4

mdoar
mdoar

Reputation: 6881

Works for me on OSX. 39 is a single quote char but I don't see where that comes from.

Upvotes: 2

Related Questions