3
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 ..

2 Answers 2

4

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

curl  -H "Content-Type: application/json; charset=UTF-8" -d "{"""username""":"""admin""","""password""":"""admin"""}" ...
Sign up to request clarification or add additional context in comments.

Comments

2

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.